From 4431eccc98acc7fa0ecc42adf0d2674a6db4d3bf Mon Sep 17 00:00:00 2001 From: kosyak Date: Tue, 1 Oct 2024 19:59:46 +0200 Subject: [PATCH] dont show start secret chat button inside secret chat --- .../eu/siacs/conversations/ui/ConversationFragment.java | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java index 7f56cc57a..9e427412e 100644 --- a/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java +++ b/src/main/java/eu/siacs/conversations/ui/ConversationFragment.java @@ -1410,10 +1410,10 @@ public class ConversationFragment extends XmppFragment final MenuItem startSecretChat = menu.findItem(R.id.action_start_secret_chat); final MenuItem encryption = menu.findItem(R.id.action_security); - boolean considerAsSecretChat = conversation.getMode() == Conversational.MODE_SINGLE && - conversation.getNextCounterpart() != null && conversation.hasPermanentCounterpart(); - if (conversation != null) { + boolean considerAsSecretChat = conversation.getMode() == Conversational.MODE_SINGLE && + conversation.getNextCounterpart() != null && conversation.hasPermanentCounterpart(); + if (conversation.getMode() == Conversation.MODE_MULTI) { menuContactDetails.setVisible(false); menuInviteContact.setVisible(conversation.getMucOptions().canInvite() && conversation.getNextCounterpart() == null); @@ -1425,6 +1425,9 @@ public class ConversationFragment extends XmppFragment menuOngoingCall.setVisible(false); startSecretChat.setVisible(false); } else { + if (considerAsSecretChat) { + startSecretChat.setVisible(false); + } menuMucParticipants.setVisible(false); final XmppConnectionService service = activity == null ? null : activity.xmppConnectionService;