diff options
author | Vitaly Takmazov | 2022-05-13 11:50:06 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2022-05-13 11:50:06 +0300 |
commit | f9210c6b524beb153f07cbd791e2520e93f6d408 (patch) | |
tree | e6a5da4800ecfc773b53a728ec1c61ae3cbee6a0 /src | |
parent | ef2c53357a9e7b3b33644cfaa2e3f7c74dd3442d (diff) |
Do not send subscriptions to banned users
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/service/SubscriptionServiceImpl.java | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/src/main/java/com/juick/service/SubscriptionServiceImpl.java index c14b258a..b8d32c6a 100644 --- a/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -67,10 +67,10 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip List<String> tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); Set<Integer> set = new HashSet<>(users.stream() + .filter(u -> !u.isBanned()) .map(User::getUid).filter(u -> Collections.disjoint(tagService.getUserBLTags(u), tagsStr)) .collect(Collectors.toList())); - if (!tags.isEmpty()) { List<Integer> tagUsers = getNamedParameterJdbcTemplate().queryForList( "SELECT st.suser_id FROM subscr_tags st " + @@ -104,7 +104,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip List<User> users = IteratorUtils.toList(CollectionUtils.union(subscribers, mentionedUsers).iterator()); if (!users.isEmpty()) { return users.stream() - .filter(u -> blacklisted || !userService.isReplyToBL(u, reply)) + .filter(u -> blacklisted || !u.isBanned() && !userService.isReplyToBL(u, reply)) .collect(Collectors.toList()); } return Collections.emptyList(); |