aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-11-12 02:46:28 +0300
committerGravatar Vitaly Takmazov2020-11-12 03:02:12 +0300
commit4a2b56a850f5bd4802c1001f0249f5ab34c6bb1e (patch)
treee4283c1e1268d8205c5bd3a1f4f85b7210a9b822 /src/main/java/com/juick
parent335900ddadd8b4943d87b7d0bf77b2e32025c703 (diff)
Do not receive mentions from blacklisted users in original posts
Diffstat (limited to 'src/main/java/com/juick')
-rw-r--r--src/main/java/com/juick/service/SubscriptionServiceImpl.java5
1 files changed, 4 insertions, 1 deletions
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<User> subscribers = userService.getUserReaders(uid);
List<User> 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<User> users = ListUtils.union(subscribers, mentionedUsers);
List<Integer> tags = tagService.getMessageTagsIDs(mid);
List<String> tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList());