feat: passing in types to parsePost for more specific handling by plugins

This commit is contained in:
Julian Lam
2024-05-17 15:22:08 -04:00
parent 78e11d6eba
commit 8cf9617630
2 changed files with 22 additions and 5 deletions

View File

@@ -256,6 +256,12 @@ Mocks.note = async (post) => {
cc.add(followersUrl);
}
const content = await posts.getPostField(post.pid, 'content');
const { postData: parsed } = await plugins.hooks.fire('filter:parse.post', {
postData: { content },
type: 'activitypub.note',
});
post.content = parsed.content;
post.content = posts.relativeToAbsolute(post.content, posts.urlRegex);
post.content = posts.relativeToAbsolute(post.content, posts.imgRegex);