From 3488fbe64cb3e66a1c536fa0ead7cf7ec86a34e9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 13 Jun 2019 12:03:35 +0200 Subject: [PATCH] expand comment why need to preserve redaction local echo on remote echo --- src/models/event.js | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/models/event.js b/src/models/event.js index abb6f8a24..560ca1103 100644 --- a/src/models/event.js +++ b/src/models/event.js @@ -788,8 +788,11 @@ utils.extend(module.exports.MatrixEvent.prototype, { const oldUnsigned = this.getUnsigned(); const oldId = this.getId(); this.event = event; - // keep being redacted if - // the event was redacted as a local echo + // if this event was redacted before it was sent, it's locally marked as redacted. + // At this point, we've received the remote echo for the event, but not yet for + // the redaction that we are sending ourselves. Preserve the locally redacted + // state by copying over redacted_because so we don't get a flash of + // redacted, not-redacted, redacted as remote echos come in if (oldUnsigned.redacted_because) { if (!this.event.unsigned) { this.event.unsigned = {};