diff --git a/lib/client.js b/lib/client.js index ad607a5b3..3f46a29eb 100644 --- a/lib/client.js +++ b/lib/client.js @@ -697,7 +697,7 @@ MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) { return self._http.authedRequest(undefined, "POST", path, undefined, data); }).then(function(res) { var roomId = res.room_id; - var syncApi = new SyncApi(self); + var syncApi = new SyncApi(self, self._clientOpts); var room = syncApi.createRoom(roomId); if (opts.syncRoom) { // v2 will do this for us @@ -2313,7 +2313,7 @@ MatrixClient.prototype.peekInRoom = function(roomId) { if (this._peekSync) { this._peekSync.stopPeeking(); } - this._peekSync = new SyncApi(this); + this._peekSync = new SyncApi(this, this._clientOpts); return this._peekSync.peek(roomId); }; @@ -2792,7 +2792,7 @@ MatrixClient.prototype.syncLeftRooms = function() { return this._syncLeftRoomsPromise; // return the ongoing request } var self = this; - var syncApi = new SyncApi(this); + var syncApi = new SyncApi(this, this._clientOpts); this._syncLeftRoomsPromise = syncApi.syncLeftRooms(); // cleanup locks @@ -2946,6 +2946,8 @@ MatrixClient.prototype.startClient = function(opts) { }; } + this._clientOpts = opts; + if (CRYPTO_ENABLED && this.sessionStore !== null) { this.uploadKeys(5); }