diff --git a/src/client.js b/src/client.js index 44a9af36e2a..04ac4b7798c 100644 --- a/src/client.js +++ b/src/client.js @@ -5475,9 +5475,8 @@ function _PojoToMatrixEventMapper(client, options) { } event.attemptDecryption(client._crypto); } - const room = client.getRoom(event.getRoomId()); - if (room && !preventReEmit) { - room.reEmitter.reEmit(event, ["Event.replaced"]); + if (!preventReEmit) { + client.reEmitter.reEmit(event, ["Event.replaced"]); } return event; } diff --git a/src/models/event.js b/src/models/event.js index 7f284bddd9e..09a78aca00d 100644 --- a/src/models/event.js +++ b/src/models/event.js @@ -904,6 +904,8 @@ utils.extend(MatrixEvent.prototype, { /** * 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. */ makeReplaced(newEvent) {