1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-12-10 07:22:27 +03:00

Change to event-level beforeRedaction event for efficiency

To avoid an O(n^2) situation with every relations container trying to process
every redaction that may occur in a room, this switches to an event-level
notification, so that the specific relations container who cares can listen to
just the events it wants to know about.
This commit is contained in:
J. Ryan Stinnett
2019-05-13 14:35:39 +01:00
parent f411d50253
commit 3a20114c39
3 changed files with 7 additions and 6 deletions

View File

@@ -661,6 +661,8 @@ utils.extend(module.exports.MatrixEvent.prototype, {
throw new Error("invalid redaction_event in makeRedacted");
}
this.emit("Event.beforeRedaction", this, redaction_event);
// we attempt to replicate what we would see from the server if
// the event had been redacted before we saw it.
//