From 4a2b56a850f5bd4802c1001f0249f5ab34c6bb1e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Nov 2020 02:46:28 +0300 Subject: Do not receive mentions from blacklisted users in original posts --- src/main/java/com/juick/service/SubscriptionServiceImpl.java | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'src/main/java/com/juick') diff --git a/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/src/main/java/com/juick/service/SubscriptionServiceImpl.java index 634b0188..c14b258a 100644 --- a/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -58,7 +58,10 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip List subscribers = userService.getUserReaders(uid); List mentionedUsers = userService.getUsersByName(MessageUtils.getMentions(msg).stream() - .map(u -> u.substring(1)).collect(Collectors.toList())); + .map(u -> u.substring(1)) + .collect(Collectors.toList())).stream() + .filter(u -> !userService.isInBL(u.getUid(), msg.getUser().getUid())) + .collect(Collectors.toList()); List users = ListUtils.union(subscribers, mentionedUsers); List tags = tagService.getMessageTagsIDs(mid); List tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); -- cgit v1.2.3