1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-29 16:43:09 +03:00

Merge pull request #536 from matrix-org/dbkr/only_reemit_events_when_needed

Only re-emit events from Event objects if needed
This commit is contained in:
David Baker
2017-09-12 19:26:58 +01:00
committed by GitHub

View File

@@ -3274,10 +3274,10 @@ function _resolve(callback, defer, res) {
function _PojoToMatrixEventMapper(client) {
function mapper(plainOldJsObject) {
const event = new MatrixEvent(plainOldJsObject);
reEmit(client, event, [
"Event.decrypted",
]);
if (event.isEncrypted()) {
reEmit(client, event, [
"Event.decrypted",
]);
event.attemptDecryption(client._crypto);
}
return event;