diff options
author | Vitaly Takmazov | 2023-01-29 05:44:21 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2023-01-30 23:49:25 +0300 |
commit | f8a7d417cb916b81cfa685175f3e6afbe6063cee (patch) | |
tree | 3f6923f3f32540e8506ce5b43b610460b4c67559 /src/main/java/com/juick/www | |
parent | dd23559a978da8980675ad4089948ade9bbc323d (diff) |
SQLite support
Diffstat (limited to 'src/main/java/com/juick/www')
-rw-r--r-- | src/main/java/com/juick/www/api/Messages.java | 3 | ||||
-rw-r--r-- | src/main/java/com/juick/www/controllers/Site.java | 3 |
2 files changed, 6 insertions, 0 deletions
diff --git a/src/main/java/com/juick/www/api/Messages.java b/src/main/java/com/juick/www/api/Messages.java index 06e3ac87..e3426454 100644 --- a/src/main/java/com/juick/www/api/Messages.java +++ b/src/main/java/com/juick/www/api/Messages.java @@ -174,6 +174,9 @@ public class Messages { // update replies counter to exclude banned replies msg.setReplies(replies.size()); if (!visitor.isAnonymous()) { + if (replies.size() > 0) { + messagesService.setRead(visitor, mid); + } userService.updateLastSeen(visitor); applicationEventPublisher .publishEvent(new SystemEvent(this, SystemActivity.read(visitor, msg))); diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java index eb483ccc..49736a60 100644 --- a/src/main/java/com/juick/www/controllers/Site.java +++ b/src/main/java/com/juick/www/controllers/Site.java @@ -582,6 +582,9 @@ public class Site { && (isReplyAuthor || !userService.isInBL(visitor.getUid(), reply.getUser().getUid()))); } } + if (replies.size() > 0 && !visitor.isAnonymous()) { + messagesService.setRead(visitor, mid); + } model.addAttribute("replies", replies); return "views/thread"; } |