From dc0576f2db2fa8638e45f1a0121d39363e5f0fdc Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Fri, 4 Sep 2020 15:31:45 +0200 Subject: [PATCH] cleanup --- src/matrix/e2ee/olm/Decryption.js | 2 +- src/matrix/room/timeline/entries/EventEntry.js | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/matrix/e2ee/olm/Decryption.js b/src/matrix/e2ee/olm/Decryption.js index d37b394f..dde9522c 100644 --- a/src/matrix/e2ee/olm/Decryption.js +++ b/src/matrix/e2ee/olm/Decryption.js @@ -115,7 +115,7 @@ export class Decryption { try { payload = JSON.parse(plaintext); } catch (err) { - throw new DecryptionError("NOT_JSON", event, {plaintext, err}); + throw new DecryptionError("PLAINTEXT_NOT_JSON", event, {plaintext, err}); } this._validatePayload(payload, event); return {event: payload, senderKey}; diff --git a/src/matrix/room/timeline/entries/EventEntry.js b/src/matrix/room/timeline/entries/EventEntry.js index 2bf5d941..23296367 100644 --- a/src/matrix/room/timeline/entries/EventEntry.js +++ b/src/matrix/room/timeline/entries/EventEntry.js @@ -22,6 +22,7 @@ export class EventEntry extends BaseEntry { super(fragmentIdComparer); this._eventEntry = eventEntry; this._decryptionError = null; + this._isEncrypted = false; } get fragmentId() { @@ -32,10 +33,6 @@ export class EventEntry extends BaseEntry { return this._eventEntry.eventIndex; } - get internalId() { - return `${this.fragmentId}|${this.entryIndex}`; - } - get content() { return this._eventEntry.event.content; } @@ -74,6 +71,7 @@ export class EventEntry extends BaseEntry { replaceWithDecrypted(event) { this._eventEntry.event = event; + this._isEncrypted = true; } setDecryptionError(err) {