aboutsummaryrefslogtreecommitdiff
path: root/src/main/java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java')
-rw-r--r--src/main/java/com/juick/service/MessagesServiceImpl.java8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/main/java/com/juick/service/MessagesServiceImpl.java b/src/main/java/com/juick/service/MessagesServiceImpl.java
index b14e9261..b6a2edb7 100644
--- a/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -704,15 +704,15 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
+ " AND NOT EXISTS (SELECT 1 FROM bl_users b WHERE b.user_id = :vid and b.bl_user_id = messages.user_id) "
+ " AND NOT EXISTS (SELECT 1 FROM bl_tags bt WHERE bt.tag_id IN "
+ "(SELECT tag_id FROM messages_tags WHERE message_id = favorites.message_id) and :vid = bt.user_id)"
- + (before > 0 ? " AND message_id < :before " : StringUtils.EMPTY)
- + " ORDER BY message_id DESC LIMIT 20) as r" + " UNION ALL " + "SELECT message_id FROM "
+ + (before > 0 ? " AND messages.message_id < :before " : StringUtils.EMPTY)
+ + " ORDER BY messages.message_id DESC LIMIT 20) as r" + " UNION ALL " + "SELECT message_id FROM "
+ "(SELECT message_id FROM messages" + " INNER JOIN users" + " ON messages.user_id = users.id"
+ " WHERE user_id = :uid AND users.banned = 0"
+ " AND NOT EXISTS (SELECT 1 FROM bl_users b WHERE b.user_id = :vid and b.bl_user_id = messages.user_id) "
+ " AND NOT EXISTS (SELECT 1 FROM bl_tags bt WHERE bt.tag_id IN "
+ "(SELECT tag_id FROM messages_tags WHERE message_id = messages.message_id) and :vid = bt.user_id)"
- + (before > 0 ? " AND message_id < :before" : StringUtils.EMPTY)
- + " AND privacy >= :privacy ORDER BY message_id DESC LIMIT 20) as m "
+ + (before > 0 ? " AND messages.message_id < :before" : StringUtils.EMPTY)
+ + " AND privacy >= :privacy ORDER BY messages.message_id DESC LIMIT 20) as m "
+ "ORDER BY message_id DESC LIMIT 20", sqlParameterSource, Integer.class);
}