aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2015-11-30 20:26:20 +0300
committerGravatar Vitaly Takmazov2015-11-30 20:26:20 +0300
commitc49596ab050db2f30d97d6f7129b8239bb4f33e3 (patch)
tree35244a5c901a7cf32137898c3243dda6196b5550 /src
parent96191fa7b653ed4b50705f6151d440dec3dc8de2 (diff)
do not show bl_users in photos
Diffstat (limited to 'src')
-rw-r--r--src/main/java/com/juick/server/MessagesQueries.java6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java
index 8bef9018..99ab1ce4 100644
--- a/src/main/java/com/juick/server/MessagesQueries.java
+++ b/src/main/java/com/juick/server/MessagesQueries.java
@@ -707,12 +707,14 @@ public class MessagesQueries {
ResultSet rs = null;
try {
if (before > 0) {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND (privacy>0 OR user_id=?) AND attach IS NOT NULL ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND (privacy>0 OR user_id=?) AND attach IS NOT NULL AND user_id NOT IN (SELECT bl_user_id FROM bl_users WHERE user_id=?) ORDER BY message_id DESC LIMIT 20");
stmt.setInt(1, before);
stmt.setInt(2, visitor_uid);
+ stmt.setInt(3, visitor_uid);
} else {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE (privacy>0 OR user_id=?) AND attach IS NOT NULL ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE (privacy>0 OR user_id=?) AND attach IS NOT NULL AND user_id NOT IN (SELECT bl_user_id FROM bl_users WHERE user_id=?) ORDER BY message_id DESC LIMIT 20");
stmt.setInt(1, visitor_uid);
+ stmt.setInt(2, visitor_uid);
}
rs = stmt.executeQuery();
rs.beforeFirst();