aboutsummaryrefslogtreecommitdiff
path: root/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java
diff options
context:
space:
mode:
authorGravatar Vitaly Takmazov2018-04-16 22:05:31 +0300
committerGravatar Vitaly Takmazov2018-04-16 22:05:31 +0300
commit516b3cf0032a6204711dc85cd42d2bf41b84e999 (patch)
tree1e31f5153260979e80d63866e6a0f070e0c32c4e /juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java
parent90d77f71c53a6349c1fb3bcf81d6f9a2a630b3e6 (diff)
www: fix refreshing notifications counter
Diffstat (limited to 'juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java')
-rw-r--r--juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java6
1 files changed, 3 insertions, 3 deletions
diff --git a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java
index 3c3c5d43..78474f49 100644
--- a/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java
+++ b/juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java
@@ -507,9 +507,12 @@ public class MessagesWWW {
return String.format("redirect:/%s/%d", msg.getUser().getName(), mid);
}
msg.VisitorCanComment = visitor.getUid() > 0;
+ List<com.juick.Message> replies = messagesService.getReplies(visitor, msg.getMid());
if (visitor.getUid() > 0) {
List<Integer> unread = messagesService.getUnread(visitor);
visitor.setUnreadCount(unread.size());
+ // this should be after getReplies to mark thread as read
+ fillUserModel(model, user, visitor);
boolean isMsgAuthor = visitor.getUid() == msg.getUser().getUid();
boolean isInBL = userService.isInBLAny(msg.getUser().getUid(), visitor.getUid());
msg.VisitorCanComment = isMsgAuthor || !(msg.ReadOnly || isInBL);
@@ -556,9 +559,6 @@ public class MessagesWWW {
model.addAttribute("visitorSubscribed", messagesService.isSubscribed(visitor.getUid(), msg.getMid()));
model.addAttribute("visitorInBL", userService.isInBL(msg.getUser().getUid(), visitor.getUid()));
model.addAttribute("recomm", messagesService.getMessageRecommendations(msg.getMid()));
- List<com.juick.Message> replies = messagesService.getReplies(visitor, msg.getMid());
- // this should be after getReplies to mark thread as read
- fillUserModel(model, user, visitor);
List<Integer> blUIDs = new ArrayList<>();
for (Message reply : replies) {
if (reply.getUser().getUid() != msg.getUser().getUid()