mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-23 03:25:12 +01:00
also sync room not in the rooms section but with new room keys
This commit is contained in:
parent
8d080163b3
commit
10003e7d3a
@ -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 New Issue
Block a user