aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service/UserServiceImpl.java
diff options
context:
space:
mode:
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.java5
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()),