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

Re-emit events from, er, Event objects

We do create Events in more places, but this is probably the only
place that matters since the only event is 'decrypted' which won't
fire for, eg. events we send.
This commit is contained in:
David Baker
2017-08-24 11:29:48 +01:00
parent 15b77861ea
commit 8d04f8b8b5

View File

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