diff --git a/spec/integ/matrix-client-methods.spec.js b/spec/integ/matrix-client-methods.spec.js index 11d228ae5..6b2a83df0 100644 --- a/spec/integ/matrix-client-methods.spec.js +++ b/spec/integ/matrix-client-methods.spec.js @@ -202,7 +202,7 @@ describe("MatrixClient", function() { event_format: "client", }); store.storeFilter(storeFilter); - client.getFilter(userId, filterId, false).done(function(gotFilter) { + client.getFilter(userId, filterId, false).then(function(gotFilter) { expect(gotFilter.getDefinition()).toEqual(httpFilterDefinition); done(); }); @@ -220,7 +220,7 @@ describe("MatrixClient", function() { httpBackend.when( "GET", "/user/" + encodeURIComponent(userId) + "/filter/" + filterId, ).respond(200, httpFilterDefinition); - client.getFilter(userId, filterId, true).done(function(gotFilter) { + client.getFilter(userId, filterId, true).then(function(gotFilter) { expect(gotFilter.getDefinition()).toEqual(httpFilterDefinition); expect(store.getFilter(userId, filterId)).toBeTruthy(); done(); @@ -248,7 +248,7 @@ describe("MatrixClient", function() { filter_id: filterId, }); - client.createFilter(filterDefinition).done(function(gotFilter) { + client.createFilter(filterDefinition).then(function(gotFilter) { expect(gotFilter.getDefinition()).toEqual(filterDefinition); expect(store.getFilter(userId, filterId)).toEqual(gotFilter); done(); @@ -295,7 +295,7 @@ describe("MatrixClient", function() { }); }).respond(200, response); - httpBackend.flush().done(function() { + httpBackend.flush().then(function() { done(); }); }); diff --git a/src/client.js b/src/client.js index 715580d01..098b3ea6e 100644 --- a/src/client.js +++ b/src/client.js @@ -3224,7 +3224,7 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) { room.oldState.paginationToken, limit, 'b'); - }).done(function(res) { + }).then(function(res) { const matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self)); if (res.state) { const stateEvents = utils.map(res.state, _PojoToMatrixEventMapper(self)); diff --git a/src/crypto/DeviceList.js b/src/crypto/DeviceList.js index 5ebd660dd..8936c4ae3 100644 --- a/src/crypto/DeviceList.js +++ b/src/crypto/DeviceList.js @@ -776,7 +776,7 @@ class DeviceListUpdateSerialiser { } return prom; - }).done(() => { + }).then(() => { logger.log('Completed key download for ' + downloadUsers); this._downloadInProgress = false; diff --git a/src/sync.js b/src/sync.js index 9a7bbc2aa..c516cdcf9 100644 --- a/src/sync.js +++ b/src/sync.js @@ -360,7 +360,7 @@ SyncApi.prototype._peekPoll = function(peekRoom, token) { room_id: peekRoom.roomId, timeout: 30 * 1000, from: token, - }, undefined, 50 * 1000).done(function(res) { + }, undefined, 50 * 1000).then(function(res) { if (self._peekRoomId !== peekRoom.roomId) { debuglog("Stopped peeking in room %s", peekRoom.roomId); return; @@ -1417,7 +1417,7 @@ SyncApi.prototype._pokeKeepAlive = function(connDidFail) { prefix: '', localTimeoutMs: 15 * 1000, }, - ).done(function() { + ).then(function() { success(); }, function(err) { if (err.httpStatus == 400 || err.httpStatus == 404) { @@ -1541,7 +1541,7 @@ SyncApi.prototype._resolveInvites = function(room) { } else { promise = client.getProfileInfo(member.userId); } - promise.done(function(info) { + promise.then(function(info) { // slightly naughty by doctoring the invite event but this means all // the code paths remain the same between invite/join display name stuff // which is a worthy trade-off for some minor pollution. diff --git a/src/utils.js b/src/utils.js index 2cf2dc509..11887c801 100644 --- a/src/utils.js +++ b/src/utils.js @@ -21,7 +21,7 @@ limitations under the License. */ const unhomoglyph = require('unhomoglyph'); -import Promise from 'bluebird'; +// import Promise from 'bluebird'; /** * Encode a dictionary of query parameters.