aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/www/controllers
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/www/controllers')
-rw-r--r--src/main/java/com/juick/www/controllers/Site.java9
1 files changed, 4 insertions, 5 deletions
diff --git a/src/main/java/com/juick/www/controllers/Site.java b/src/main/java/com/juick/www/controllers/Site.java
index bfe7d654..d0ea3dee 100644
--- a/src/main/java/com/juick/www/controllers/Site.java
+++ b/src/main/java/com/juick/www/controllers/Site.java
@@ -190,7 +190,7 @@ public class Site {
model.addAttribute("headers", head);
model.addAttribute("visitor", visitor);
model.addAttribute("noindex", !(paramShow == null && paramBefore == 0));
- List<Message> msgs = messagesService.getMessages(visitor, mids);
+ List<Message> msgs = messagesService.getMessages(visitor.getUid(), mids);
msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser())));
if (!visitor.isAnonymous()) {
fillUserModel(model, visitor, visitor);
@@ -301,7 +301,7 @@ public class Site {
model.addAttribute("noindex", paramShow == null && before == 0);
fillUserModel(model, user, visitor);
model.addAttribute("paramTag", paramTag);
- List<Message> msgs = messagesService.getMessages(visitor, mids);
+ List<Message> msgs = messagesService.getMessages(visitor.getUid(), mids);
msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser())));
if (!visitor.isAnonymous()) {
List<Integer> unread = messagesService.getUnread(visitor);
@@ -423,7 +423,7 @@ public class Site {
model.addAttribute("title", title);
List<Integer> mids = messagesService.getTag(paramTag.TID, visitor.getUid(), before,
(visitor.isAnonymous()) ? 40 : 20);
- List<Message> msgs = messagesService.getMessages(visitor, mids);
+ List<Message> msgs = messagesService.getMessages(visitor.getUid(), mids);
msgs.forEach(m -> m.getUser().setAvatar(webApp.getAvatarWebPath(m.getUser())));
if (!visitor.isAnonymous()) {
List<Integer> unread = messagesService.getUnread(visitor);
@@ -504,7 +504,7 @@ public class Site {
throw new HttpForbiddenException();
}
visitor.setAvatar(webApp.getAvatarWebPath(visitor));
- Optional<Message> message = messagesService.getMessage(mid);
+ Optional<Message> message = messagesService.getMessage(visitor.getUid(), mid);
if (message.isEmpty()) {
throw new HttpNotFoundException();
@@ -567,7 +567,6 @@ public class Site {
+ msg.getTags().stream().map(Tag::getName).collect(Collectors.joining(", ")) + "\" />\n";
}
model.addAttribute("headers", headers);
- model.addAttribute("visitorSubscribed", messagesService.isSubscribed(visitor.getUid(), msg.getMid()));
model.addAttribute("visitorInBL", userService.isInBL(msg.getUser().getUid(), visitor.getUid()));
List<Integer> blUIDs = new ArrayList<>();
for (Message reply : replies) {