From a817a9aaf9b9b240982a411b60a2c20536c64516 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Sep 2020 16:41:03 +0200 Subject: [PATCH] return decrypted type and content --- src/matrix/room/timeline/entries/EventEntry.js | 9 ++++----- 1 file changed, 4 insertions(+), 5 deletions(-) diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index f305cb09..d6d2f335 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -22,7 +22,7 @@ export class EventEntry extends BaseEntry { super(fragmentIdComparer); this._eventEntry = eventEntry; this._decryptionError = null; - this._isEncrypted = false; + this._decryptedEvent = null; } get event() { @@ -38,7 +38,7 @@ export class EventEntry extends BaseEntry { } get content() { - return this._eventEntry.event.content; + return this._decryptedEvent?.content || this._eventEntry.event.content; } get prevContent() { @@ -46,7 +46,7 @@ export class EventEntry extends BaseEntry { } get eventType() { - return this._eventEntry.event.type; + return this._decryptedEvent?.type || this._eventEntry.event.type; } get stateKey() { @@ -74,8 +74,7 @@ export class EventEntry extends BaseEntry { } replaceWithDecrypted(event) { - this._eventEntry.event = event; - this._isEncrypted = true; + this._decryptedEvent = event; } setDecryptionError(err) {