aboutsummaryrefslogtreecommitdiff
path: root/src/com/juick/server/MessagesQueries.java
diff options
context:
space:
mode:
authorGravatar Ugnich Anton2014-03-20 02:03:21 +0700
committerGravatar Ugnich Anton2014-03-20 02:03:21 +0700
commit2f56add386e112200dcbd7bdc3f6eefae4c1efb3 (patch)
treedab48fbea282da015ac33e3960ee465a23d08427 /src/com/juick/server/MessagesQueries.java
parente2c257fecfd08e745c1f051bde14a32a43255f26 (diff)
getVKTokens, messages popularity
Diffstat (limited to 'src/com/juick/server/MessagesQueries.java')
-rw-r--r--src/com/juick/server/MessagesQueries.java12
1 files changed, 6 insertions, 6 deletions
diff --git a/src/com/juick/server/MessagesQueries.java b/src/com/juick/server/MessagesQueries.java
index fa84f476..1f4c8408 100644
--- a/src/com/juick/server/MessagesQueries.java
+++ b/src/com/juick/server/MessagesQueries.java
@@ -291,21 +291,21 @@ public class MessagesQueries {
try {
if (visitor_uid > 1) {
if (before > 0) {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND (privacy>0 OR user_id=?) AND user_id NOT IN (SELECT bl_user_id FROM bl_users WHERE user_id=?) ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND popular>=-1 AND (privacy>0 OR user_id=?) 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 user_id NOT IN (SELECT bl_user_id FROM bl_users WHERE user_id=?) ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE popular>=-1 AND (privacy>0 OR user_id=?) 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);
}
} else {
if (before > 0) {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND privacy>0 ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND popular>=-1 AND privacy>0 ORDER BY message_id DESC LIMIT 20");
stmt.setInt(1, before);
} else {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE privacy>0 ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE popular>=-1 AND privacy>0 ORDER BY message_id DESC LIMIT 20");
}
}
@@ -560,10 +560,10 @@ public class MessagesQueries {
ResultSet rs = null;
try {
if (before > 0) {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND privacy>0 AND popular=1 ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE message_id<? AND privacy>0 AND popular>0 ORDER BY message_id DESC LIMIT 20");
stmt.setInt(1, before);
} else {
- stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE privacy>0 AND popular=1 ORDER BY message_id DESC LIMIT 20");
+ stmt = sql.prepareStatement("SELECT message_id FROM messages WHERE privacy>0 AND popular>0 ORDER BY message_id DESC LIMIT 20");
}
rs = stmt.executeQuery();
rs.beforeFirst();