aboutsummaryrefslogtreecommitdiff
path: root/juick-server/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'juick-server/src/main')
-rw-r--r--juick-server/src/main/java/com/juick/server/TelegramBotManager.java1
-rw-r--r--juick-server/src/main/java/com/juick/server/api/Messages.java2
2 files changed, 3 insertions, 0 deletions
diff --git a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
index 01dd7b66..c946d7c9 100644
--- a/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
+++ b/juick-server/src/main/java/com/juick/server/TelegramBotManager.java
@@ -312,6 +312,7 @@ public class TelegramBotManager implements NotificationListener {
messagesService.setLastReadComment(userService.getUserByUID(userId)
.orElseThrow(IllegalStateException::new), source.getMid(), source.getRid());
User user = userService.getUserByUID(userId).orElseThrow(IllegalStateException::new);
+ userService.updateLastSeen(user);
applicationEventPublisher.publishEvent(
new MessageReadEvent(this, user, source));
}
diff --git a/juick-server/src/main/java/com/juick/server/api/Messages.java b/juick-server/src/main/java/com/juick/server/api/Messages.java
index 424ea492..4f0009dd 100644
--- a/juick-server/src/main/java/com/juick/server/api/Messages.java
+++ b/juick-server/src/main/java/com/juick/server/api/Messages.java
@@ -174,6 +174,7 @@ public class Messages {
msg.setRecommendations(new HashSet<>(messagesService.getMessageRecommendations(msg.getMid())));
List<com.juick.Message> replies = messagesService.getReplies(visitor, mid);
if (!visitor.isAnonymous()) {
+ userService.updateLastSeen(visitor);
applicationEventPublisher.publishEvent(
new MessageReadEvent(this, visitor, msg));
}
@@ -189,6 +190,7 @@ public class Messages {
if (!visitor.isAnonymous()) {
messagesService.setLastReadComment(visitor, mid, rid);
Message msg = messagesService.getMessage(mid);
+ userService.updateLastSeen(visitor);
applicationEventPublisher.publishEvent(
new MessageReadEvent(this, visitor, msg));
return IOUtils.toByteArray(