diff options
author | Vitaly Takmazov | 2020-11-12 02:46:28 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-11-12 03:02:12 +0300 |
commit | 4a2b56a850f5bd4802c1001f0249f5ab34c6bb1e (patch) | |
tree | e4283c1e1268d8205c5bd3a1f4f85b7210a9b822 /src/main | |
parent | 335900ddadd8b4943d87b7d0bf77b2e32025c703 (diff) |
Do not receive mentions from blacklisted users in original posts
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/service/SubscriptionServiceImpl.java | 5 |
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()); |