aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main/java/com/juick/service
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-09-10 11:39:33 +0300
committerGravatar Vitaly Takmazov2018-09-10 11:39:33 +0300
commitb300e063d389c8ea205c23af7011b0dfd6f6ba7f (patch)
treedfe5f120cd8f35cedb59c1a3319be2c067f21620 /juick-server/src/main/java/com/juick/service
parent2673dabfba6e1322bbe5cf3f53f962643b516b90 (diff)
Discuss feed for anonymous
Diffstat (limited to 'juick-server/src/main/java/com/juick/service')
-rw-r--r--juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java8
1 files changed, 8 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
index a90cba55..b0daa9fb 100644
--- a/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
+++ b/juick-server/src/main/java/com/juick/service/MessagesServiceImpl.java
@@ -572,6 +572,14 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ
.addValue("uid", uid)
.addValue("to", new Timestamp(to));
+ if (uid == 0) {
+ return getNamedParameterJdbcTemplate().query("SELECT message_id FROM messages" +
+ (to != 0 ?
+ " WHERE updated < :to " : StringUtils.EMPTY) +
+ " ORDER BY updated DESC, message_id DESC LIMIT 20",
+ sqlParameterSource,
+ (rs, rowNum) -> rs.getInt(1));
+ }
return getNamedParameterJdbcTemplate().query(
"SELECT messages.message_id, messages.updated FROM subscr_messages " +
"INNER JOIN messages ON messages.message_id=subscr_messages.message_id " +