pass platform to room

as we'll need it to access crypto and creating blobs
This commit is contained in:
Bruno Windels 2020-11-11 10:47:19 +01:00
parent c289bcd097
commit 0c70a67ebb
2 changed files with 4 additions and 4 deletions

View File

@ -362,7 +362,7 @@ export class Session {
pendingEvents, pendingEvents,
user: this._user, user: this._user,
createRoomEncryption: this._createRoomEncryption, createRoomEncryption: this._createRoomEncryption,
clock: this._platform.clock platform: this._platform
}); });
this._rooms.add(roomId, room); this._rooms.add(roomId, room);
return room; return room;

View File

@ -34,7 +34,7 @@ import {DecryptionSource} from "../e2ee/common.js";
const EVENT_ENCRYPTED_TYPE = "m.room.encrypted"; const EVENT_ENCRYPTED_TYPE = "m.room.encrypted";
export class Room extends EventEmitter { export class Room extends EventEmitter {
constructor({roomId, storage, hsApi, mediaRepository, emitCollectionChange, pendingEvents, user, createRoomEncryption, getSyncToken, clock}) { constructor({roomId, storage, hsApi, mediaRepository, emitCollectionChange, pendingEvents, user, createRoomEncryption, getSyncToken, platform}) {
super(); super();
this._roomId = roomId; this._roomId = roomId;
this._storage = storage; this._storage = storage;
@ -52,7 +52,7 @@ export class Room extends EventEmitter {
this._createRoomEncryption = createRoomEncryption; this._createRoomEncryption = createRoomEncryption;
this._roomEncryption = null; this._roomEncryption = null;
this._getSyncToken = getSyncToken; this._getSyncToken = getSyncToken;
this._clock = clock; this._platform = platform;
this._observedEvents = null; this._observedEvents = null;
} }
@ -569,7 +569,7 @@ export class Room extends EventEmitter {
} }
}, },
user: this._user, user: this._user,
clock: this._clock clock: this._platform.clock
}); });
if (this._roomEncryption) { if (this._roomEncryption) {
this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline)); this._timeline.enableEncryption(this._decryptEntries.bind(this, DecryptionSource.Timeline));