aboutsummaryrefslogtreecommitdiff
path: root/libdino/src/service/conversation_manager.vala
diff options
context:
space:
mode:
authoreerielili <lionel@les-miquelots.net>2024-08-25 13:32:38 +0000
committerGitHub <noreply@github.com>2024-08-25 13:32:38 +0000
commit45755727db79a2935376d24e7bde7eadb0f2f7ca (patch)
tree73715da99c9d980079df6f2d561822364655e04d /libdino/src/service/conversation_manager.vala
parent62cdea3a5e701c04f3a7fd9d6b5f48e28fef1f72 (diff)
parent51252f74c94c17d56aa75534652bdc5d43a504cb (diff)
downloaddino-45755727db79a2935376d24e7bde7eadb0f2f7ca.tar.gz
dino-45755727db79a2935376d24e7bde7eadb0f2f7ca.zip
Merge branch 'master' into add-yourselfadd-yourself
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;