diff options
author | fiaxh <git@lightrise.org> | 2020-06-17 14:30:46 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2020-06-23 15:54:12 +0200 |
commit | 886a519d8543cba45792a08210093c851f20a2a0 (patch) | |
tree | 639180b362b79518e0ea0523c39ae7fe36877cd6 /main/src/ui/chat_input | |
parent | 6d41071da1f01678b9ab449ed7f00391067da43a (diff) | |
download | dino-886a519d8543cba45792a08210093c851f20a2a0.tar.gz dino-886a519d8543cba45792a08210093c851f20a2a0.zip |
Don't offer encryption in MUC PMs
Diffstat (limited to 'main/src/ui/chat_input')
-rw-r--r-- | main/src/ui/chat_input/encryption_button.vala | 17 |
1 files changed, 15 insertions, 2 deletions
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) { |