1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2025-08-18 05:42:00 +03:00

Make things work again

This commit is contained in:
Kegan Dougal
2015-12-09 10:42:05 +00:00
parent 2b659656cc
commit 3543abf7bd
3 changed files with 134 additions and 31 deletions

View File

@@ -621,9 +621,10 @@ MatrixClient.prototype.joinRoom = function(roomIdOrAlias, opts, callback) {
this._http.authedRequest(undefined, "POST", path, undefined, {}).then(
function(res) {
var roomId = res.room_id;
var room = createNewRoom(self, roomId); // XXX FIXME TODO
var syncApi = new SyncApi(self);
var room = syncApi.createRoom(roomId);
if (opts.syncRoom) {
return _syncRoom(self, room); // XXX FIXME TODO
return syncApi.syncRoom(room);
}
return q(room);
}, function(err) {
@@ -2424,12 +2425,6 @@ function checkTurnServers(client) {
});
}
function retryTimeMsForAttempt(attempt) {
// 2,4,8,16,32,64,128,128,128,... seconds
// max 2^7 secs = 2.1 mins
return Math.pow(2, Math.min(attempt, 7)) * 1000;
}
function _reject(callback, defer, err) {
if (callback) {
callback(err);
@@ -2456,6 +2451,10 @@ function _PojoToMatrixEventMapper(client) {
return mapper;
}
MatrixClient.prototype.getEventMapper = function() {
return _PojoToMatrixEventMapper(this);
};
// Identity Server Operations
// ==========================
@@ -2502,8 +2501,6 @@ MatrixClient.prototype.generateClientSecret = function() {
module.exports.MatrixClient = MatrixClient;
/** */
module.exports.CRYPTO_ENABLED = CRYPTO_ENABLED;
/** */
module.exports.EventMapper = _PojoToMatrixEventMapper;
// MatrixClient Event JSDocs