diff options
author | Vitaly Takmazov | 2018-07-04 17:53:09 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-07-04 17:53:09 +0300 |
commit | ea412bd40ab3576ac752c30705a13c0a7dfac27b (patch) | |
tree | 2d0fc44c3d0b1c6268707f1666fabf67f797e88f /juick-server/src/main/java/com/juick/service/UserServiceImpl.java | |
parent | 2e563514d4d3bd5f6ae325376d6c47671e9a474b (diff) |
do not show notifications from banned threads
Diffstat (limited to 'juick-server/src/main/java/com/juick/service/UserServiceImpl.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/service/UserServiceImpl.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java index bc448151..050fc281 100644 --- a/juick-server/src/main/java/com/juick/service/UserServiceImpl.java +++ b/juick-server/src/main/java/com/juick/service/UserServiceImpl.java @@ -461,9 +461,12 @@ public class UserServiceImpl extends BaseJdbcService implements UserService { "INNER JOIN banned ON banned.reply_id = replies.replyto " + "WHERE replies.message_id = :mid) " + "SELECT COUNT(reply_id) from replies " + + "INNER JOIN messages m ON m.message_id = replies.message_id " + "WHERE replies.message_id = :mid " + "AND replies.reply_id = :rid " + - "AND EXISTS (SELECT 1 FROM banned WHERE banned.reply_id = replies.reply_id) ", + "AND (EXISTS (SELECT 1 FROM banned WHERE banned.reply_id = replies.reply_id) " + + "OR EXISTS (SELECT 1 FROM bl_users b WHERE b.user_id = :uid AND b.bl_user_id = m.user_id)" + + "OR EXISTS (SELECT 1 FROM bl_users b WHERE b.bl_user_id = :uid AND b.user_id = m.user_id))", new MapSqlParameterSource("uid", user.getUid()) .addValue("mid", reply.getMid()) .addValue("rid", reply.getRid()), |