forked from mystiq/hydrogen-web
also sync room not in the rooms section but with new room keys
This commit is contained in:
parent
8d080163b3
commit
10003e7d3a
1 changed files with 14 additions and 0 deletions
|
@ -258,6 +258,20 @@ export class Sync {
|
|||
|
||||
const newKeysByRoom = sessionState.preparation?.newKeysByRoom;
|
||||
|
||||
// add any rooms with new keys but no sync response to the list of rooms to be synced
|
||||
if (newKeysByRoom) {
|
||||
const {hasOwnProperty} = Object.prototype;
|
||||
for (const roomId of newKeysByRoom.keys()) {
|
||||
const isRoomInResponse = response.rooms?.join && hasOwnProperty.call(response.rooms.join, roomId);
|
||||
if (!isRoomInResponse) {
|
||||
let room = this._session.rooms.get(roomId);
|
||||
if (room) {
|
||||
roomStates.push(new RoomSyncProcessState(room, {}, room.membership));
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
await Promise.all(roomStates.map(async rs => {
|
||||
const newKeys = newKeysByRoom?.get(rs.room.id);
|
||||
rs.preparation = await log.wrap("room", log => rs.room.prepareSync(
|
||||
|
|
Loading…
Reference in a new issue