aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/conversation_manager.vala
diff options
context:
space:
mode:
authorfiaxh <git@lightrise.org>2024-05-26 17:28:28 +0200
committerfiaxh <git@lightrise.org>2024-05-26 17:28:28 +0200
commitf1be90c02f26c942e67978fd6d10ff2feeec8f9e (patch)
tree2c3ad321b92350ecb69d2ee33e187bc410ab2c9d /libdino/src/service/conversation_manager.vala
parentfe45ab575c687febc1f342b0882a7597bd6ae9dc (diff)
downloaddino-f1be90c02f26c942e67978fd6d10ff2feeec8f9e.tar.gz
dino-f1be90c02f26c942e67978fd6d10ff2feeec8f9e.zip
Add logic for OMEMO by default setting
Diffstat (limited to 'libdino/src/service/conversation_manager.vala')
-rw-r--r--libdino/src/service/conversation_manager.vala8
1 files changed, 8 insertions, 0 deletions
diff --git a/libdino/src/service/conversation_manager.vala b/libdino/src/service/conversation_manager.vala
index f966ccc7..a757e8af 100644
--- a/libdino/src/service/conversation_manager.vala
+++ b/libdino/src/service/conversation_manager.vala
@@ -48,6 +48,14 @@ public class ConversationManager : StreamInteractionModule, Object {
// Create a new converation
Conversation conversation = new Conversation(jid, account, type);
+ // Set encryption for conversation
+ if (type == Conversation.Type.CHAT ||
+ (type == Conversation.Type.GROUPCHAT && stream_interactor.get_module(MucManager.IDENTITY).is_private_room(account, jid))) {
+ conversation.encryption = Application.get_default().settings.get_default_encryption(account);
+ } else {
+ conversation.encryption = Encryption.NONE;
+ }
+
add_conversation(conversation);
conversation.persist(db);
return conversation;