diff options
author | fiaxh <git@lightrise.org> | 2024-05-26 17:28:28 +0200 |
---|---|---|
committer | fiaxh <git@lightrise.org> | 2024-05-26 17:28:28 +0200 |
commit | f1be90c02f26c942e67978fd6d10ff2feeec8f9e (patch) | |
tree | 2c3ad321b92350ecb69d2ee33e187bc410ab2c9d /libdino/src/service/conversation_manager.vala | |
parent | fe45ab575c687febc1f342b0882a7597bd6ae9dc (diff) | |
download | dino-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.vala | 8 |
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; |