mirror of
https://github.com/Nheko-Reborn/nheko.git
synced 2024-11-22 19:08:58 +03:00
Enable encryption for DMs when started from the profile
This commit is contained in:
parent
9714486447
commit
9570c3ccc4
1 changed files with 5 additions and 0 deletions
|
@ -1323,6 +1323,11 @@ ChatPage::startChat(QString userid, std::optional<bool> encryptionEnabled)
|
||||||
req.preset = mtx::requests::Preset::TrustedPrivateChat;
|
req.preset = mtx::requests::Preset::TrustedPrivateChat;
|
||||||
req.visibility = mtx::common::RoomVisibility::Private;
|
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)) {
|
if (encryptionEnabled.value_or(false)) {
|
||||||
mtx::events::StrippedEvent<mtx::events::state::Encryption> enc;
|
mtx::events::StrippedEvent<mtx::events::state::Encryption> enc;
|
||||||
enc.type = mtx::events::EventType::RoomEncryption;
|
enc.type = mtx::events::EventType::RoomEncryption;
|
||||||
|
|
Loading…
Reference in a new issue