From b23f3b9182d78dfabb37b6a1c21d060a365b2574 Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Thu, 12 Apr 2018 11:36:11 +0300 Subject: www: mark thread as read on first view --- juick-www/src/main/java/com/juick/www/controllers/MessagesWWW.java | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'juick-www/src/main/java/com') 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 ecd60a52..80be605f 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 @@ -493,7 +493,6 @@ public class MessagesWWW { return String.format("redirect:/%s/%d", msg.getUser().getName(), mid); } msg.VisitorCanComment = visitor.getUid() > 0; - fillUserModel(model, user, visitor); if (visitor.getUid() > 0) { boolean isMsgAuthor = visitor.getUid() == msg.getUser().getUid(); boolean isInBL = userService.isInBLAny(msg.getUser().getUid(), visitor.getUid()); @@ -542,7 +541,8 @@ public class MessagesWWW { model.addAttribute("visitorInBL", userService.isInBL(msg.getUser().getUid(), visitor.getUid())); model.addAttribute("recomm", messagesService.getMessageRecommendations(msg.getMid())); List replies = messagesService.getReplies(visitor, msg.getMid()); - + // this should be after getReplies to mark thread as read + fillUserModel(model, user, visitor); List blUIDs = new ArrayList<>(); for (Message reply : replies) { if (reply.getUser().getUid() != msg.getUser().getUid() -- cgit v1.2.3