You've already forked matrix-js-sdk
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:
12
lib/sync.js
12
lib/sync.js
@@ -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:");
|
||||
|
||||
Reference in New Issue
Block a user