From 277638b1078caa1553c622aec3fe76d54c518e40 Mon Sep 17 00:00:00 2001 From: RMidhunSuresh Date: Fri, 14 Jan 2022 16:15:16 +0530 Subject: [PATCH] Override methods in NonPersistedEventEntry This will prevent redactions to entries fetched from hs showing "message is being redacted" and will instead show "message is redacted" --- .../room/timeline/entries/NonPersistedEventEntry.js | 10 ++++++++++ 1 file changed, 10 insertions(+) diff --git a/src/matrix/room/timeline/entries/NonPersistedEventEntry.js b/src/matrix/room/timeline/entries/NonPersistedEventEntry.js index cb8df8a3..cc3be88a 100644 --- a/src/matrix/room/timeline/entries/NonPersistedEventEntry.js +++ b/src/matrix/room/timeline/entries/NonPersistedEventEntry.js @@ -31,4 +31,14 @@ export class NonPersistedEventEntry extends EventEntry { get isNonPersisted() { return true; } + + // overridden here because we reuse addLocalRelation() for updating this entry + // we don't want the RedactedTile created using this entry to ever show "is being redacted" + get isRedacting() { + return false; + } + + get isRedacted() { + return !!this._pendingRedactions; + } }