summary refs log tree commit diff
path: root/src/timeline/EventStore.cpp
diff options
context:
space:
mode:
authorNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 20:08:59 +0100
committerNicolas Werner <nicolas.werner@hotmail.de>2021-01-23 20:08:59 +0100
commit7bc57f76f77ac282afb78c3e4d02dd647dc0d449 (patch)
treec8d31c3161f3455787def7fbdb776fb6e9645cda /src/timeline/EventStore.cpp
parentMerge pull request #395 from LorenDB/master (diff)
downloadnheko-7bc57f76f77ac282afb78c3e4d02dd647dc0d449.tar.xz
Request unknown message indices
Diffstat (limited to 'src/timeline/EventStore.cpp')
-rw-r--r--src/timeline/EventStore.cpp21
1 files changed, 15 insertions, 6 deletions
diff --git a/src/timeline/EventStore.cpp b/src/timeline/EventStore.cpp

index 41001081..d7629456 100644 --- a/src/timeline/EventStore.cpp +++ b/src/timeline/EventStore.cpp
@@ -543,12 +543,21 @@ EventStore::decryptEvent(const IdIndex &idx, if (decryptionResult.error) { switch (*decryptionResult.error) { - case olm::DecryptionErrorCode::MissingSession: { - dummy.content.body = - tr("-- Encrypted Event (No keys found for decryption) --", - "Placeholder, when the message was not decrypted yet or can't be " - "decrypted.") - .toStdString(); + case olm::DecryptionErrorCode::MissingSession: + case olm::DecryptionErrorCode::MissingSessionIndex: { + if (decryptionResult.error == olm::DecryptionErrorCode::MissingSession) + dummy.content.body = + tr("-- Encrypted Event (No keys found for decryption) --", + "Placeholder, when the message was not decrypted yet or can't " + "be " + "decrypted.") + .toStdString(); + else + dummy.content.body = + tr("-- Encrypted Event (Key not valid for this index) --", + "Placeholder, when the message can't be decrypted with this " + "key since it is not valid for this index ") + .toStdString(); nhlog::crypto()->info("Could not find inbound megolm session ({}, {}, {})", index.room_id, index.session_id,