You've already forked matrix-js-sdk
mirror of
https://github.com/matrix-org/matrix-js-sdk.git
synced 2025-08-05 00:42:10 +03:00
Rip out some more bluebird
This commit is contained in:
@@ -202,7 +202,7 @@ describe("MatrixClient", function() {
|
|||||||
event_format: "client",
|
event_format: "client",
|
||||||
});
|
});
|
||||||
store.storeFilter(storeFilter);
|
store.storeFilter(storeFilter);
|
||||||
client.getFilter(userId, filterId, false).done(function(gotFilter) {
|
client.getFilter(userId, filterId, false).then(function(gotFilter) {
|
||||||
expect(gotFilter.getDefinition()).toEqual(httpFilterDefinition);
|
expect(gotFilter.getDefinition()).toEqual(httpFilterDefinition);
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
@@ -220,7 +220,7 @@ describe("MatrixClient", function() {
|
|||||||
httpBackend.when(
|
httpBackend.when(
|
||||||
"GET", "/user/" + encodeURIComponent(userId) + "/filter/" + filterId,
|
"GET", "/user/" + encodeURIComponent(userId) + "/filter/" + filterId,
|
||||||
).respond(200, httpFilterDefinition);
|
).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(gotFilter.getDefinition()).toEqual(httpFilterDefinition);
|
||||||
expect(store.getFilter(userId, filterId)).toBeTruthy();
|
expect(store.getFilter(userId, filterId)).toBeTruthy();
|
||||||
done();
|
done();
|
||||||
@@ -248,7 +248,7 @@ describe("MatrixClient", function() {
|
|||||||
filter_id: filterId,
|
filter_id: filterId,
|
||||||
});
|
});
|
||||||
|
|
||||||
client.createFilter(filterDefinition).done(function(gotFilter) {
|
client.createFilter(filterDefinition).then(function(gotFilter) {
|
||||||
expect(gotFilter.getDefinition()).toEqual(filterDefinition);
|
expect(gotFilter.getDefinition()).toEqual(filterDefinition);
|
||||||
expect(store.getFilter(userId, filterId)).toEqual(gotFilter);
|
expect(store.getFilter(userId, filterId)).toEqual(gotFilter);
|
||||||
done();
|
done();
|
||||||
@@ -295,7 +295,7 @@ describe("MatrixClient", function() {
|
|||||||
});
|
});
|
||||||
}).respond(200, response);
|
}).respond(200, response);
|
||||||
|
|
||||||
httpBackend.flush().done(function() {
|
httpBackend.flush().then(function() {
|
||||||
done();
|
done();
|
||||||
});
|
});
|
||||||
});
|
});
|
||||||
|
@@ -3224,7 +3224,7 @@ MatrixClient.prototype.scrollback = function(room, limit, callback) {
|
|||||||
room.oldState.paginationToken,
|
room.oldState.paginationToken,
|
||||||
limit,
|
limit,
|
||||||
'b');
|
'b');
|
||||||
}).done(function(res) {
|
}).then(function(res) {
|
||||||
const matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self));
|
const matrixEvents = utils.map(res.chunk, _PojoToMatrixEventMapper(self));
|
||||||
if (res.state) {
|
if (res.state) {
|
||||||
const stateEvents = utils.map(res.state, _PojoToMatrixEventMapper(self));
|
const stateEvents = utils.map(res.state, _PojoToMatrixEventMapper(self));
|
||||||
|
@@ -776,7 +776,7 @@ class DeviceListUpdateSerialiser {
|
|||||||
}
|
}
|
||||||
|
|
||||||
return prom;
|
return prom;
|
||||||
}).done(() => {
|
}).then(() => {
|
||||||
logger.log('Completed key download for ' + downloadUsers);
|
logger.log('Completed key download for ' + downloadUsers);
|
||||||
|
|
||||||
this._downloadInProgress = false;
|
this._downloadInProgress = false;
|
||||||
|
@@ -360,7 +360,7 @@ SyncApi.prototype._peekPoll = function(peekRoom, token) {
|
|||||||
room_id: peekRoom.roomId,
|
room_id: peekRoom.roomId,
|
||||||
timeout: 30 * 1000,
|
timeout: 30 * 1000,
|
||||||
from: token,
|
from: token,
|
||||||
}, undefined, 50 * 1000).done(function(res) {
|
}, undefined, 50 * 1000).then(function(res) {
|
||||||
if (self._peekRoomId !== peekRoom.roomId) {
|
if (self._peekRoomId !== peekRoom.roomId) {
|
||||||
debuglog("Stopped peeking in room %s", peekRoom.roomId);
|
debuglog("Stopped peeking in room %s", peekRoom.roomId);
|
||||||
return;
|
return;
|
||||||
@@ -1417,7 +1417,7 @@ SyncApi.prototype._pokeKeepAlive = function(connDidFail) {
|
|||||||
prefix: '',
|
prefix: '',
|
||||||
localTimeoutMs: 15 * 1000,
|
localTimeoutMs: 15 * 1000,
|
||||||
},
|
},
|
||||||
).done(function() {
|
).then(function() {
|
||||||
success();
|
success();
|
||||||
}, function(err) {
|
}, function(err) {
|
||||||
if (err.httpStatus == 400 || err.httpStatus == 404) {
|
if (err.httpStatus == 400 || err.httpStatus == 404) {
|
||||||
@@ -1541,7 +1541,7 @@ SyncApi.prototype._resolveInvites = function(room) {
|
|||||||
} else {
|
} else {
|
||||||
promise = client.getProfileInfo(member.userId);
|
promise = client.getProfileInfo(member.userId);
|
||||||
}
|
}
|
||||||
promise.done(function(info) {
|
promise.then(function(info) {
|
||||||
// slightly naughty by doctoring the invite event but this means all
|
// slightly naughty by doctoring the invite event but this means all
|
||||||
// the code paths remain the same between invite/join display name stuff
|
// the code paths remain the same between invite/join display name stuff
|
||||||
// which is a worthy trade-off for some minor pollution.
|
// which is a worthy trade-off for some minor pollution.
|
||||||
|
@@ -21,7 +21,7 @@ limitations under the License.
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
const unhomoglyph = require('unhomoglyph');
|
const unhomoglyph = require('unhomoglyph');
|
||||||
import Promise from 'bluebird';
|
// import Promise from 'bluebird';
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Encode a dictionary of query parameters.
|
* Encode a dictionary of query parameters.
|
||||||
|
Reference in New Issue
Block a user