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 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 enc; enc.type = mtx::events::EventType::RoomEncryption;