fix: better handling for remote posts that do not contain content

This commit is contained in:
Julian Lam
2024-09-16 15:46:12 -04:00
parent 1a0a2cd17b
commit 3c55d1024d

View File

@@ -123,8 +123,12 @@ Mocks.post = async (objects) => {
let edited = new Date(updated);
edited = Number.isNaN(edited.valueOf()) ? undefined : edited;
if (content && content.length) {
content = sanitize(content, sanitizeConfig);
content = await activitypub.helpers.remoteAnchorToLocalProfile(content);
} else {
content = '<em>This post did not contain any content.</em>';
}
const payload = {
uid,