aboutsummaryrefslogtreecommitdiff
path: root/src/main/java/com/juick/server/CommandsManager.java
diff options
context:
space:
mode:
Diffstat (limited to 'src/main/java/com/juick/server/CommandsManager.java')
-rw-r--r--src/main/java/com/juick/server/CommandsManager.java7
1 files changed, 6 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/CommandsManager.java b/src/main/java/com/juick/server/CommandsManager.java
index fa3c5537..087ba444 100644
--- a/src/main/java/com/juick/server/CommandsManager.java
+++ b/src/main/java/com/juick/server/CommandsManager.java
@@ -25,6 +25,7 @@ import com.juick.model.CommandResult;
import com.juick.model.TagStats;
import com.juick.server.helpers.annotation.UserCommand;
import com.juick.server.util.HttpUtils;
+import com.juick.server.www.WebApp;
import com.juick.service.*;
import com.juick.service.activities.DeleteMessageEvent;
import com.juick.service.component.*;
@@ -75,6 +76,8 @@ public class CommandsManager {
private ApplicationEventPublisher applicationEventPublisher;
@Inject
private ImagesService imagesService;
+ @Inject
+ private WebApp webApp;
public CommandResult processCommand(@Nonnull User user, String data, @Nonnull URI attachment) throws Exception {
if (!user.isAnonymous()) {
@@ -127,6 +130,7 @@ public class CommandsManager {
imagesService.saveImageWithPreviews(attachmentFName, fname);
}
Message msg = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new);
+ msg.getUser().setAvatar(webApp.getAvatarWebPath(msg.getUser()));
subscriptionService.subscribeMessage(msg, user);
applicationEventPublisher.publishEvent(new MessageReadEvent(this, user, msg));
@@ -160,7 +164,7 @@ public class CommandsManager {
String body = arguments[1];
User user_to = userService.getUserByName(arguments[0]);
-
+ user_to.setAvatar(webApp.getAvatarWebPath(user_to));
if (!user_to.isAnonymous()) {
if (!userService.isInBLAny(user_to.getUid(), user_from.getUid())) {
if (pmQueriesService.createPM(user_from.getUid(), user_to.getUid(), body)) {
@@ -537,6 +541,7 @@ public class CommandsManager {
Message original = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new);
subscriptionService.subscribeMessage(original, user);
Message reply = messagesService.getReply(mid, newrid);
+ reply.getUser().setAvatar(webApp.getAvatarWebPath(reply.getUser()));
applicationEventPublisher.publishEvent(new MessageEvent(this, reply, subscriptionService.getUsersSubscribedToComments(original, reply)));
return CommandResult.build(reply,"Reply posted.\n#" + mid + "/" + newrid + " "
+ "https://juick.com/m/" + mid + "#" + newrid,