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

emit from MatrixEvent.makeReplaced instead of Room

now that event can be replaced from Relations instead of Room

Also make `makeReplaced` non-destructive by not touching the original
event.content, so it can be undone by later calls.
This commit is contained in:
Bruno Windels
2019-05-16 14:37:49 +01:00
parent 3cd2b3925a
commit 69d25c1498
2 changed files with 14 additions and 12 deletions

View File

@@ -4168,6 +4168,10 @@ function _PojoToMatrixEventMapper(client) {
]);
event.attemptDecryption(client._crypto);
}
const room = client.getRoom(event.getRoomId());
if (room) {
room.reEmitter.reEmit(event, ["Event.replaced"]);
}
return event;
}
return mapper;