Merge pull request #1818 from matrix-org/dbkr/dont_notify_bad_encrypted

Don't notify for bad encrypted messages
pull/21833/head
David Baker 2018-03-29 18:33:44 +01:00 committed by GitHub
commit a79c558763
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 4 additions and 0 deletions

View File

@ -256,6 +256,10 @@ const Notifier = {
}, },
onEventDecrypted: function(ev) { onEventDecrypted: function(ev) {
// 'decrypted' means the decryption process has finished: it may have failed,
// in which case it might decrypt soon if the keys arrive
if (ev.isDecryptionFailure()) return;
const idx = this.pendingEncryptedEventIds.indexOf(ev.getId()); const idx = this.pendingEncryptedEventIds.indexOf(ev.getId());
if (idx === -1) return; if (idx === -1) return;