From 886a519d8543cba45792a08210093c851f20a2a0 Mon Sep 17 00:00:00 2001 From: fiaxh Date: Wed, 17 Jun 2020 14:30:46 +0200 Subject: Don't offer encryption in MUC PMs --- main/src/ui/chat_input/encryption_button.vala | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'main/src') diff --git a/main/src/ui/chat_input/encryption_button.vala b/main/src/ui/chat_input/encryption_button.vala index 859b7baa..11466931 100644 --- a/main/src/ui/chat_input/encryption_button.vala +++ b/main/src/ui/chat_input/encryption_button.vala @@ -86,8 +86,21 @@ public class EncryptionButton : MenuButton { } private void update_visibility() { - visible = !stream_interactor.get_module(MucManager.IDENTITY).is_public_room(conversation.account, conversation.counterpart) || - conversation.encryption != Encryption.NONE; + if (conversation.encryption != Encryption.NONE) { + visible = true; + return; + } + switch (conversation.type_) { + case Conversation.Type.CHAT: + visible = true; + break; + case Conversation.Type.GROUPCHAT_PM: + visible = false; + break; + case Conversation.Type.GROUPCHAT: + visible = stream_interactor.get_module(MucManager.IDENTITY).is_private_room(conversation.account, conversation.counterpart); + break; + } } public new void set_conversation(Conversation conversation) { -- cgit v1.2.3-70-g09d2