diff options
author | Vitaly Takmazov | 2018-04-16 17:17:03 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-04-16 17:17:03 +0300 |
commit | 90d77f71c53a6349c1fb3bcf81d6f9a2a630b3e6 (patch) | |
tree | 0f6fe63eb1ae414688dcfad346091412bbf4b065 /juick-server-jdbc | |
parent | a27d737896aafc392c0455a9789895386c5e1cf9 (diff) |
server: mark comments from blacklisted users as read
Diffstat (limited to 'juick-server-jdbc')
-rw-r--r-- | juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java | 9 |
1 files changed, 7 insertions, 2 deletions
diff --git a/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java index 64143c32..7626651a 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/SubscriptionServiceImpl.java @@ -91,10 +91,15 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip } return userService.getUsersByID(set); } + @Override + public List<User> getUsersSubscribedToComments(@Nonnull final Message msg, @Nonnull final Message reply) { + return getUsersSubscribedToComments(msg, reply, false); + } @Transactional(readOnly = true) @Override - public List<User> getUsersSubscribedToComments(@Nonnull final Message msg, @Nonnull final Message reply) { + public List<User> getUsersSubscribedToComments(@Nonnull final Message msg, @Nonnull final Message reply, + boolean blacklisted) { List<Integer> userids = getJdbcTemplate().queryForList( "SELECT suser_id FROM subscr_messages WHERE message_id=? AND suser_id!=?", Integer.class, @@ -102,7 +107,7 @@ public class SubscriptionServiceImpl extends BaseJdbcService implements Subscrip if (!userids.isEmpty()) { return userService.getUsersByID(userids.stream() - .filter(u -> !userService.isInBLAny(u, reply.getUser().getUid())) + .filter(u -> blacklisted || !userService.isInBLAny(u, reply.getUser().getUid())) .collect(Collectors.toList())); } return Collections.emptyList(); |