diff options
author | Vitaly Takmazov | 2019-10-02 12:53:23 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2019-10-02 12:53:23 +0300 |
commit | 36e49df53a4d79bf4dc8e5594fc319d641b461c8 (patch) | |
tree | a3e99e749d22a518ca7593390102b6d694f0d950 /src/main/java/com/juick/server/CommandsManager.java | |
parent | 51ff8e2d57e196f1ced45887a1cd23e941f32f20 (diff) |
Fetch external user data before reply event
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, |