refactor: move plugin hook methods to plugin.hooks.*

This commit is contained in:
Julian Lam
2020-11-20 16:06:26 -05:00
parent 3b1c03ed50
commit 6e2da9966e
136 changed files with 550 additions and 541 deletions

View File

@@ -48,7 +48,7 @@ Posts.getPostsByPids = async function (pids, uid) {
let posts = await Posts.getPostsData(pids);
posts = await Promise.all(posts.map(p => Posts.parsePost(p)));
posts = await user.blocks.filter(uid, posts);
const data = await plugins.fireHook('filter:post.getPosts', { posts: posts, uid: uid });
const data = await plugins.hooks.fire('filter:post.getPosts', { posts: posts, uid: uid });
if (!data || !Array.isArray(data.posts)) {
return [];
}