diff options
author | Vitaly Takmazov | 2015-11-30 20:41:58 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2015-11-30 20:41:58 +0300 |
commit | 2071369b1e58ea8a0904f27a50cf027b9e9fd0f2 (patch) | |
tree | 65f98fceb03174caba8dba41b08a1ef40570ff95 /src | |
parent | 0c451fd02654ffbd56b6422affe8da38ed810644 (diff) | |
parent | 23666546ca2c0f1ee492b1bea8c0ea83c8c04a2b (diff) |
Merge branch 'develop' of ssh://den.jabber.ru:2205/var/lib/git/com.juick.server into develop
Diffstat (limited to 'src')
-rw-r--r-- | src/main/java/com/juick/server/MessagesQueries.java | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/src/main/java/com/juick/server/MessagesQueries.java b/src/main/java/com/juick/server/MessagesQueries.java index 82fef672..c13aec2b 100644 --- a/src/main/java/com/juick/server/MessagesQueries.java +++ b/src/main/java/com/juick/server/MessagesQueries.java @@ -747,11 +747,11 @@ public class MessagesQueries { try { if (before > 0) { - stmt = sqlSearch.prepareStatement("SELECT id AS message_id FROM messages WHERE MATCH(?) AND id<? ORDER BY id DESC LIMIT 25"); + stmt = sqlSearch.prepareStatement("SELECT id AS message_id FROM messages WHERE MATCH(?) AND id<? AND user_id NOT IN (SELECT id from users WHERE banned=1) ORDER BY id DESC LIMIT 25"); stmt.setString(1, search); stmt.setInt(2, before); } else { - stmt = sqlSearch.prepareStatement("SELECT id AS message_id FROM messages WHERE MATCH(?) ORDER BY id DESC LIMIT 25"); + stmt = sqlSearch.prepareStatement("SELECT id AS message_id FROM messages WHERE MATCH(?) AND user_id NOT IN (SELECT id from users WHERE banned=1) ORDER BY id DESC LIMIT 25"); stmt.setString(1, search); } rs = stmt.executeQuery(); @@ -768,7 +768,7 @@ public class MessagesQueries { ArrayList<Integer> mids = new ArrayList<Integer>(20); if (mids0.size() > 0) { try { - stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id IN (" + Utils.convertArrayInt2String(mids0) + ") AND privacy>0 ORDER BY message_id DESC LIMIT 20"); + stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id IN (" + Utils.convertArrayInt2String(mids0) + ") AND privacy>0 AND user_id NOT IN (SELECT id from users WHERE banned=1) ORDER BY message_id DESC LIMIT 20"); rs = stmt.executeQuery(); rs.beforeFirst(); while (rs.next()) { |