Add toggle to disable decrypting notifications

This commit is contained in:
Nicolas Werner 2022-10-13 17:37:28 +02:00
parent 37009906bb
commit 8a4bb32b4a
No known key found for this signature in database
GPG key ID: C8D75E610773F2D9
5 changed files with 44 additions and 6 deletions

View file

@ -276,7 +276,8 @@ ChatPage::ChatPage(QSharedPointer<UserSettings> userSettings, QObject *parent)
if (auto encryptedEvent =
std::get_if<mtx::events::EncryptedEvent<mtx::events::msg::Encrypted>>(
&event)) {
&event);
encryptedEvent && userSettings_->decryptNotifications()) {
MegolmSessionIndex index(room_id, encryptedEvent->content);
auto result = olm::decryptEvent(index, *encryptedEvent);