From 3e352b5a943a347acfd351d8defdf35e5ca584a4 Mon Sep 17 00:00:00 2001 From: Maxim Logaev Date: Tue, 26 Mar 2024 19:59:29 +0300 Subject: [PATCH] Use default encryption only for 1-on-1 chats Signed-off-by: Maxim Logaev --- main/data/settings_dialog.ui | 2 +- main/src/ui/conversation_view_controller.vala | 20 +------------------ 2 files changed, 2 insertions(+), 20 deletions(-) diff --git a/main/data/settings_dialog.ui b/main/data/settings_dialog.ui index 44f3e81f..63c4f51e 100644 --- a/main/data/settings_dialog.ui +++ b/main/data/settings_dialog.ui @@ -11,7 +11,7 @@ - Default encryption + Default encryption for 1-on-1 chats diff --git a/main/src/ui/conversation_view_controller.vala b/main/src/ui/conversation_view_controller.vala index 9ab4e5b8..b87977b9 100644 --- a/main/src/ui/conversation_view_controller.vala +++ b/main/src/ui/conversation_view_controller.vala @@ -119,22 +119,7 @@ public class ConversationViewController : Object { return; } - bool visible = false; - - // FIXME duplicate logic from encryption_button.vala - 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; - } - - if (visible && conversation.encryption == UNKNOWN) { + if (conversation.type_ == Conversation.Type.CHAT && conversation.encryption == UNKNOWN) { Dino.Entities.Settings settings = Dino.Application.get_default().settings; if (settings.default_encryption == UNKNOWN) { @@ -182,9 +167,6 @@ public class ConversationViewController : Object { conversation.encryption = settings.default_encryption; } } - else if (!visible) { - conversation.encryption = Encryption.NONE; - } } public void select_conversation(Conversation? conversation, bool default_initialize_conversation) {