From 25f20f878684d4e2aa6f34056a2e008d9d8cf909 Mon Sep 17 00:00:00 2001 From: Arne Date: Tue, 12 Nov 2024 18:55:08 +0100 Subject: [PATCH] Do not offer 'add reaction' when not participating --- .../conversations/services/XmppConnectionService.java | 7 ++++++- .../eu/siacs/conversations/ui/ConversationFragment.java | 3 ++- 2 files changed, 8 insertions(+), 2 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java index e2305de9b..6c1bf81c0 100644 --- a/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java +++ b/src/main/java/eu/siacs/conversations/services/XmppConnectionService.java @@ -5430,7 +5430,12 @@ public class XmppConnectionService extends Service { final var newReactions = new HashSet<>(reactions); newReactions.removeAll(message.getAggregatedReactions().ourReactions); if (conversation.getMode() == Conversational.MODE_MULTI) { - final var self = conversation.getMucOptions().getSelf(); + final var mucOptions = conversation.getMucOptions(); + if (!mucOptions.participating()) { + Log.d(Config.LOGTAG,"not participating in MUC"); + return false; + } + final var self = mucOptions.getSelf(); final String occupantId = self.getOccupantId(); reactToId = message.getServerMsgId(); combinedReactions = diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 1375b344a..f1f4ce4cd 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1755,7 +1755,8 @@ public class ConversationFragment extends XmppFragment setThread(message.getThread()); conversation.setUserSelectedThread(true); } - addReaction(message); + if (conversation.getMode() == Conversational.MODE_SINGLE + || conversation.getMucOptions().participating()) addReaction(message); }); messageListAdapter.setOnMessageBoxSwiped(message -> {