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

Guest room ID fixes / initialSync support

This commit is contained in:
Kegan Dougal
2015-12-04 15:31:07 +00:00
parent 71d5756223
commit 02a605f368
2 changed files with 18 additions and 0 deletions

View File

@@ -2080,6 +2080,10 @@ function doInitialSync(client, historyLen, includeArchived, attempt) {
if (includeArchived) {
qps.archived = true;
}
if (client._guestRooms && client._isGuest) {
console.log(client._guestRooms);
qps.room_id = JSON.stringify(client._guestRooms);
}
client._http.authedRequest(
undefined, "GET", "/initialSync", qps
).done(function(data) {
@@ -2251,6 +2255,16 @@ MatrixClient.prototype.startClient = function(opts) {
};
function prepareForSync(client, attempt) {
if (client.isGuest()) {
// no push rules for guests
doInitialSync(
client,
client._config.initialSyncLimit,
client._config.includeArchivedRooms
);
return;
}
attempt = attempt || 1;
client.pushRules().done(function(result) {
client.pushRules = result;