diff options
Diffstat (limited to 'juick-server/src/main/java/com/juick/server/CommandsManager.java')
-rw-r--r-- | juick-server/src/main/java/com/juick/server/CommandsManager.java | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/juick-server/src/main/java/com/juick/server/CommandsManager.java b/juick-server/src/main/java/com/juick/server/CommandsManager.java index 297e986f..597604c6 100644 --- a/juick-server/src/main/java/com/juick/server/CommandsManager.java +++ b/juick-server/src/main/java/com/juick/server/CommandsManager.java @@ -123,7 +123,7 @@ public class CommandsManager { Message msg = messagesService.getMessage(mid); subscriptionService.subscribeMessage(msg, user); - applicationEventPublisher.publishEvent(new MessageReadEvent(this, Collections.singletonList(user), msg)); + applicationEventPublisher.publishEvent(new MessageReadEvent(this, user, msg)); applicationEventPublisher.publishEvent(new MessageEvent(this, msg, subscriptionService.getSubscribedUsers(msg.getUser().getUid(), msg))); return CommandResult.build(msg, "New message posted.\n#" + msg.getMid() + " https://juick.com/m/" + msg.getMid(), String.format("[New message](%s) posted", PlainTextFormatter.formatUrl(msg))); } @@ -358,7 +358,7 @@ public class CommandsManager { if (subscribe) { if (subscriptionService.subscribeMessage(msg, user)) { applicationEventPublisher.publishEvent( - new MessageReadEvent(this, Collections.singletonList(user), msg)); + new MessageReadEvent(this, user, msg)); return CommandResult.fromString("Subscribed"); } } else { @@ -411,7 +411,7 @@ public class CommandsManager { if (showReplies) { List<com.juick.Message> replies = messagesService.getReplies(user, mid); applicationEventPublisher.publishEvent( - new MessageReadEvent(this, Collections.singletonList(user), msg)); + new MessageReadEvent(this, user, msg)); replies.add(0, msg); return CommandResult.fromString(String.join("\n", replies.stream().map(PlainTextFormatter::formatPostSummary).collect(Collectors.toList()))); @@ -514,7 +514,7 @@ public class CommandsManager { } int newrid = messagesService.createReply(mid, rid, user, txt, attachmentType); applicationEventPublisher.publishEvent( - new MessageReadEvent(this, Collections.singletonList(user), msg)); + new MessageReadEvent(this, user, msg)); if (haveAttachment) { String fname = String.format("%d-%d.%s", mid, newrid, attachmentType); imagesService.saveImageWithPreviews(attachmentFName, fname); |