From 965700272b62a03f43685027b0bb947c953e2fbf Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Tue, 11 May 2021 16:09:01 +0200 Subject: [PATCH] remove archivedRoom map, it's unused and just complicating for now --- src/matrix/Session.js | 17 ----------------- 1 file changed, 17 deletions(-) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 961adf11..20f303fb 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -56,7 +56,6 @@ export class Session { this._sessionInfo = sessionInfo; this._rooms = new ObservableMap(); this._roomUpdateCallback = (room, params) => this._rooms.update(room.id, params); - this._archivedRooms = null; this._invites = new ObservableMap(); this._inviteUpdateCallback = (invite, params) => this._invites.update(invite.id, params); this._user = new User(sessionInfo.userId); @@ -511,15 +510,6 @@ export class Session { applyRoomCollectionChangesAfterSync(inviteStates, roomStates, archivedRoomStates) { // update the collections after sync - if (this._archivedRooms) { - for (const ars of archivedRoomStates) { - if (ars.shouldAdd) { - this._archivedRooms.add(ars.id, ars.archivedRoom); - } else if (ars.shouldRemove) { - this._archivedRooms.remove(ars.id); - } - } - } for (const rs of roomStates) { if (rs.shouldAdd) { this._rooms.add(rs.id, rs.room); @@ -651,13 +641,6 @@ export class Session { return RoomStatus.joined; } else { const isInvited = !!this._invites.get(roomId); - let isArchived; - if (this._archivedRooms) { - isArchived = !!this._archivedRooms.get(roomId); - } else { - const txn = await this._storage.readTxn([this._storage.storeNames.archivedRoomSummary]); - isArchived = await txn.archivedRoomSummary.has(roomId); - } if (isInvited && isArchived) { return RoomStatus.invitedAndArchived; } else if (isInvited) {