1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-26 17:03:12 +03:00

Merge pull request #1491 from matrix-org/t3chguy/fix/9836

Fix re-emit of Event.replaced to be on client and not room
This commit is contained in:
Michael Telatynski
2020-10-06 22:50:14 +01:00
committed by GitHub
2 changed files with 4 additions and 3 deletions

View File

@@ -5591,9 +5591,8 @@ function _PojoToMatrixEventMapper(client, options) {
} }
event.attemptDecryption(client._crypto); event.attemptDecryption(client._crypto);
} }
const room = client.getRoom(event.getRoomId()); if (!preventReEmit) {
if (room && !preventReEmit) { client.reEmitter.reEmit(event, ["Event.replaced"]);
room.reEmitter.reEmit(event, ["Event.replaced"]);
} }
return event; return event;
} }

View File

@@ -904,6 +904,8 @@ utils.extend(MatrixEvent.prototype, {
/** /**
* Set an event that replaces the content of this event, through an m.replace relation. * Set an event that replaces the content of this event, through an m.replace relation.
* *
* @fires module:models/event.MatrixEvent#"Event.replaced"
*
* @param {MatrixEvent?} newEvent the event with the replacing content, if any. * @param {MatrixEvent?} newEvent the event with the replacing content, if any.
*/ */
makeReplaced(newEvent) { makeReplaced(newEvent) {