diff options
author | Vitaly Takmazov | 2020-10-11 23:18:40 +0300 |
---|---|---|
committer | Vitaly Takmazov | 2020-10-11 23:18:40 +0300 |
commit | 4dd89bc86c5223ee40ccc8ddb4d21aa6d5e5b64e (patch) | |
tree | ec8332c127feaa376f63c956c7c072780b62714b /src/main | |
parent | 318e0cfda08c35b87e56969d3f320889de6bbc0f (diff) |
Do not subscribe anonymous user to comments
Diffstat (limited to 'src/main')
-rw-r--r-- | src/main/java/com/juick/CommandsManager.java | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/src/main/java/com/juick/CommandsManager.java b/src/main/java/com/juick/CommandsManager.java index 66a45f9d..3795e2b6 100644 --- a/src/main/java/com/juick/CommandsManager.java +++ b/src/main/java/com/juick/CommandsManager.java @@ -138,7 +138,9 @@ public class CommandsManager { } Message msg = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new); msg.getUser().setAvatar(webApp.getAvatarUrl(msg.getUser())); - subscriptionService.subscribeMessage(msg, user); + if (!user.isAnonymous()) { + subscriptionService.subscribeMessage(msg, user); + } applicationEventPublisher.publishEvent(new SystemEvent(this, SystemActivity.read(user, msg))); applicationEventPublisher.publishEvent(new SystemEvent(this, @@ -562,7 +564,9 @@ public class CommandsManager { applicationEventPublisher.publishEvent( new SystemEvent(this, SystemActivity.read(user, msg.get()))); Message original = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new); - subscriptionService.subscribeMessage(original, user); + if (!user.isAnonymous()) { + subscriptionService.subscribeMessage(original, user); + } Message reply = messagesService.getReply(mid, newrid); if (reply.getUser().isAnonymous()) { reply.setUser(activityPubManager.personToUser(reply.getUser().getUri())); |