From f9210c6b524beb153f07cbd791e2520e93f6d408 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Fri, 13 May 2022 11:50:06 +0300 Subject: Do not send subscriptions to banned users --- src/main/java/com/juick/service/SubscriptionServiceImpl.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'src/main/java/com') 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 tagsStr = tagService.getMessageTags(mid).stream().map(t -> t.getTag().getName()).collect(Collectors.toList()); Set 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 tagUsers = getNamedParameterJdbcTemplate().queryForList( "SELECT st.suser_id FROM subscr_tags st " + @@ -104,7 +104,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip List 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(); -- cgit v1.2.3