1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

expand comment why need to preserve redaction local echo on remote echo

This commit is contained in:
Bruno Windels
2019-06-13 12:03:35 +02:00
parent 811a98ad19
commit 3488fbe64c

View File

@@ -788,8 +788,11 @@ utils.extend(module.exports.MatrixEvent.prototype, {
const oldUnsigned = this.getUnsigned(); const oldUnsigned = this.getUnsigned();
const oldId = this.getId(); const oldId = this.getId();
this.event = event; this.event = event;
// keep being redacted if // if this event was redacted before it was sent, it's locally marked as redacted.
// the event was redacted as a local echo // 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 (oldUnsigned.redacted_because) {
if (!this.event.unsigned) { if (!this.event.unsigned) {
this.event.unsigned = {}; this.event.unsigned = {};