Skip to content

Commit

Permalink
feat: add filter.topics.getPostReplies
Browse files Browse the repository at this point in the history
  • Loading branch information
barisusakli committed Oct 20, 2020
1 parent 7a8f704 commit 7a01949
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion src/topics/posts.js
Original file line number Diff line number Diff line change
Expand Up @@ -240,7 +240,11 @@ module.exports = function (Topics) {
const uniquePids = _.uniq(_.flatten(arrayOfReplyPids));

let replyData = await posts.getPostsFields(uniquePids, ['pid', 'uid', 'timestamp']);
replyData = await user.blocks.filter(callerUid, replyData);
const result = await plugins.fireHook('filter:topics.getPostReplies', {
uid: callerUid,
replies: replyData,
});
replyData = await user.blocks.filter(callerUid, result.replies);

const uids = replyData.map(replyData => replyData && replyData.uid);

Expand Down

0 comments on commit 7a01949

Please sign in to comment.