From 20220a008dbf92e06d9d6f7e9aaaac31343b701e Mon Sep 17 00:00:00 2001 From: Vitaly Takmazov Date: Sat, 4 Feb 2023 05:41:24 +0300 Subject: Do not try to subscribe to already subscribed message --- src/main/java/com/juick/CommandsManager.java | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/main/java/com/juick/CommandsManager.java b/src/main/java/com/juick/CommandsManager.java index 702433e0..6019c7f9 100644 --- a/src/main/java/com/juick/CommandsManager.java +++ b/src/main/java/com/juick/CommandsManager.java @@ -584,7 +584,7 @@ public class CommandsManager { applicationEventPublisher.publishEvent( new SystemEvent(this, SystemActivity.read(user, msg.get()))); Message original = messagesService.getMessage(mid).orElseThrow(IllegalStateException::new); - if (!user.isAnonymous()) { + if (!user.isAnonymous() && !original.isSubscribed()) { subscriptionService.subscribeMessage(original, user); } Message reply = messagesService.getReply(mid, newrid); -- cgit v1.2.3