Use default encryption only for 1-on-1 chats
Signed-off-by: Maxim Logaev <maxlogaev@proton.me>
This commit is contained in:
parent
47365dd7e0
commit
3e352b5a94
|
@ -11,7 +11,7 @@
|
|||
<object class="AdwPreferencesGroup">
|
||||
<child>
|
||||
<object class="AdwActionRow">
|
||||
<property name="title" translatable="yes">Default encryption</property>
|
||||
<property name="title" translatable="yes">Default encryption for 1-on-1 chats</property>
|
||||
<child>
|
||||
<object class="GtkBox" id="default_encryption_box">
|
||||
<child>
|
||||
|
|
|
@ -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) {
|
||||
|
|
Loading…
Reference in a new issue