diff options
author | Vitaly Takmazov | 2018-09-10 11:39:33 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2018-09-10 11:39:33 +0300 |
commit | b300e063d389c8ea205c23af7011b0dfd6f6ba7f (patch) | |
tree | dfe5f120cd8f35cedb59c1a3319be2c067f21620 /juick-server/src/main/java/com/juick/service | |
parent | 2673dabfba6e1322bbe5cf3f53f962643b516b90 (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.java | 8 |
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 " + |