From 08c4a98c90f7f243d4b14a8caafe48745296222b Mon Sep 17 00:00:00 2001 From: Dessalines Date: Thu, 2 Dec 2021 11:38:09 -0500 Subject: [PATCH] Dont receive post room comments from blocked users. --- src/shared/components/post/post.tsx | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/shared/components/post/post.tsx b/src/shared/components/post/post.tsx index 4c7f5021..dcc9871f 100644 --- a/src/shared/components/post/post.tsx +++ b/src/shared/components/post/post.tsx @@ -551,8 +551,13 @@ export class Post extends Component { } else if (op == UserOperation.CreateComment) { let data = wsJsonToRes(msg).data; + // Don't get comments from the post room, if the creator is blocked + let creatorBlocked = UserService.Instance.myUserInfo?.person_blocks + .map(pb => pb.target.id) + .includes(data.comment_view.creator.id); + // Necessary since it might be a user reply, which has the recipients, to avoid double - if (data.recipient_ids.length == 0) { + if (data.recipient_ids.length == 0 && !creatorBlocked) { this.state.postRes.comments.unshift(data.comment_view); insertCommentIntoTree(this.state.commentTree, data.comment_view); this.state.postRes.post_view.counts.comments++;