diff options
Diffstat (limited to 'src/main/java/com/juick/server/CommandsManager.java')
-rw-r--r-- | src/main/java/com/juick/server/CommandsManager.java | 8 |
1 files changed, 7 insertions, 1 deletions
diff --git a/src/main/java/com/juick/server/CommandsManager.java b/src/main/java/com/juick/server/CommandsManager.java index 6fd88f07..598772f1 100644 --- a/src/main/java/com/juick/server/CommandsManager.java +++ b/src/main/java/com/juick/server/CommandsManager.java @@ -84,6 +84,8 @@ public class CommandsManager { private ImagesService imagesService; @Inject private WebApp webApp; + @Inject + private ActivityPubManager activityPubManager; public CommandResult processCommand(@Nonnull User user, String data, @Nonnull URI attachment) throws Exception { if (!user.isAnonymous()) { @@ -566,7 +568,11 @@ 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.getAvatarUrl(reply.getUser())); + if (reply.getUser().isAnonymous()) { + reply.setUser(activityPubManager.personToUser(reply.getUser().getUri())); + } else { + reply.getUser().setAvatar(webApp.getAvatarUrl(reply.getUser())); + } applicationEventPublisher.publishEvent( new SystemEvent(this, SystemActivity.message(reply.getUser(), reply, |