1
0
mirror of https://github.com/matrix-org/matrix-js-sdk.git synced 2026-01-03 23:22:30 +03:00

Do bear minimum leave room handling so rejecting invites / leaving rooms are displayed correctly.

This commit is contained in:
Kegan Dougal
2015-12-15 16:21:36 +00:00
parent 65ef1dfd75
commit 4cd6f615b3

View File

@@ -307,7 +307,17 @@ SyncApi.prototype._sync = function(syncOptions, attempt) {
accountDataEvents.forEach(function(e) { client.emit("event", e); });
});
// Ignore leave rooms for now (TODO: Honour includeArchived opt)
// Handle leaves
leaveRooms.forEach(function(leaveObj) {
// Do the bear minimum to register rejected invites / you leaving rooms
var room = leaveObj.room;
var timelineEvents = self._mapSyncEventsFormat(leaveObj.timeline, room);
room.addEvents(timelineEvents);
// TODO: honour includeArchived opt
timelineEvents.forEach(function(e) { client.emit("event", e); });
});
}
catch (e) {
console.error("Caught /sync error:");