aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2020-02-05 10:19:26 +0300
committerGravatar Vitaly Takmazov2020-02-05 10:19:26 +0300
commit6fbe53de47e0301e563a83f775ca6a78eed78fc4 (patch)
treeb4511daeecc09171a9155602e0ef91504b61e1e7 /src/main/java/com/juick/service
parent23aba1cc93d1ee28a52560b2205a992494d04a33 (diff)
Do not count unread messages in threads from blacklisted users
Diffstat (limited to 'src/main/java/com/juick/service')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index c405fde4..8f1387cf 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -1156,9 +1156,11 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
return jdbcTemplate.queryForList(
"select subscr_messages.message_id " +
"from subscr_messages inner join messages on subscr_messages.message_id=messages.message_id " +
- "where subscr_messages.suser_id=? and " +
+ "where subscr_messages.suser_id=? " +
+ "AND NOT EXISTS (SELECT 1 FROM bl_users WHERE " +
+ "user_id = ? AND bl_user_id = messages.user_id) AND " +
"messages.replies>subscr_messages.last_read_rid",
- Integer.class, user.getUid());
+ Integer.class, user.getUid(), user.getUid());
}
@Transactional