From 350f6942078e67b15e160ecffc913ba0cef624be Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Mon, 16 Apr 2018 14:14:27 +0300 Subject: server: do not make last read mark lower --- .../src/main/java/com/juick/service/MessagesServiceImpl.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'juick-server-jdbc/src/main/java/com/juick/service') diff --git a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java index 996fb550..c0dccc6a 100644 --- a/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java +++ b/juick-server-jdbc/src/main/java/com/juick/service/MessagesServiceImpl.java @@ -921,7 +921,7 @@ public class MessagesServiceImpl extends BaseJdbcService implements MessagesServ @Transactional @Override public void setLastReadComment(User user, Integer mid, Integer rid) { - jdbcTemplate.update("UPDATE subscr_messages SET last_read_rid=? WHERE message_id=? AND suser_id=?", + jdbcTemplate.update("UPDATE subscr_messages SET last_read_rid=GREATEST(?, last_read_rid) WHERE message_id=? AND suser_id=?", rid, mid, user.getUid()); } -- cgit v1.2.3