summary refs log tree commit diff
path: root/src
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2022-08-13 15:51:04 +0200
committerNicolas Werner <nicolas.werner@hotmail.de>2022-08-13 15:51:04 +0200
commit9570c3ccc4ea427d52e35c3dc8b2d9baf7a08246 (patch)
tree7e1bc9986e5e9afd15498d73b9b1b9fd98032311 /src
parentHide uneditable spaces from menu (diff)
downloadnheko-9570c3ccc4ea427d52e35c3dc8b2d9baf7a08246.tar.xz
Enable encryption for DMs when started from the profile
Diffstat (limited to 'src')
-rw-r--r--src/ChatPage.cpp5
1 files changed, 5 insertions, 0 deletions
diff --git a/src/ChatPage.cpp b/src/ChatPage.cpp

index d7fbfefa..9daf8d4d 100644 --- a/src/ChatPage.cpp +++ b/src/ChatPage.cpp
@@ -1323,6 +1323,11 @@ ChatPage::startChat(QString userid, std::optional<bool> encryptionEnabled) req.preset = mtx::requests::Preset::TrustedPrivateChat; req.visibility = mtx::common::RoomVisibility::Private; + if (!encryptionEnabled.has_value()) { + if (auto keys = cache::client()->userKeys(userid.toStdString())) + encryptionEnabled = !keys->device_keys.empty(); + } + if (encryptionEnabled.value_or(false)) { mtx::events::StrippedEvent<mtx::events::state::Encryption> enc; enc.type = mtx::events::EventType::RoomEncryption;