1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-11-28 05:03:59 +03:00

Revert "Lazy loading: don't block on setting up room crypto"

This commit is contained in:
Bruno Windels
2018-08-23 14:05:57 +02:00
committed by GitHub
parent 580e95605e
commit 5cf2ebea4f
5 changed files with 56 additions and 103 deletions

View File

@@ -1085,16 +1085,15 @@ SyncApi.prototype._processSyncResponse = async function(
self._processEventsForNotifs(room, timelineEvents);
function processRoomEvent(e) {
async function processRoomEvent(e) {
client.emit("event", e);
if (e.isState() && e.getType() == "m.room.encryption" && self.opts.crypto) {
self.opts.crypto.onCryptoEvent(e);
await self.opts.crypto.onCryptoEvent(e);
}
}
stateEvents.forEach(processRoomEvent);
timelineEvents.forEach(processRoomEvent);
await Promise.mapSeries(stateEvents, processRoomEvent);
await Promise.mapSeries(timelineEvents, processRoomEvent);
ephemeralEvents.forEach(function(e) {
client.emit("event", e);
});