From 5e125e646cbad945776364f2dbf3943fbb85061a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C5=A0imon=20Brandner?= Date: Mon, 31 Jan 2022 12:21:12 +0100 Subject: [PATCH] Don't decrypt redacted messages (#2143) --- src/models/event.ts | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/src/models/event.ts b/src/models/event.ts index dedc666d96e..82693ae9eca 100644 --- a/src/models/event.ts +++ b/src/models/event.ts @@ -679,7 +679,12 @@ export class MatrixEvent extends EventEmitter { } public shouldAttemptDecryption() { - return this.isEncrypted() && !this.isBeingDecrypted() && !this.clearEvent; + if (this.isRedacted()) return false; + if (this.isBeingDecrypted()) return false; + if (this.clearEvent) return false; + if (!this.isEncrypted()) return false; + + return true; } /**