aboutsummaryrefslogtreecommitdiff
path: root/main
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2020-06-17 14:30:46 +0200
committerfiaxh <git@lightrise.org>2020-06-23 15:54:12 +0200
commit886a519d8543cba45792a08210093c851f20a2a0 (patch)
tree639180b362b79518e0ea0523c39ae7fe36877cd6 /main
parent6d41071da1f01678b9ab449ed7f00391067da43a (diff)
downloaddino-886a519d8543cba45792a08210093c851f20a2a0.tar.gz
dino-886a519d8543cba45792a08210093c851f20a2a0.zip
Don't offer encryption in MUC PMs
Diffstat (limited to 'main')
-rw-r--r--main/src/ui/chat_input/encryption_button.vala17
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) {