diff options
Diffstat (limited to 'juick-www/src/main/java')
-rw-r--r-- | juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java | 6 |
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() |