feat: attachments support

This commit is contained in:
Julian Lam
2024-02-16 12:07:29 -05:00
parent 8b0ccc8090
commit e5b6ee97bd
5 changed files with 47 additions and 10 deletions

View File

@@ -61,15 +61,12 @@ module.exports = function (Posts) {
return postData;
}
if (!activitypub.helpers.isUri(postData.pid) || postData.hasOwnProperty('sourceContent')) {
({ postData } = await plugins.hooks.fire('filter:parse.post', { postData }));
} else {
postData.content = await Posts.sanitize(postData.content);
}
({ postData } = await plugins.hooks.fire('filter:parse.post', { postData }));
postData.content = translator.escape(postData.content);
if (postData.pid) {
cache.set(pid, postData.content);
}
return postData;
};