mirror of
https://github.com/vector-im/hydrogen-web.git
synced 2024-12-22 19:14:52 +01:00
also sync room not in the rooms section but with new room keys
This commit is contained in:
parent
8d080163b3
commit
10003e7d3a
@ -257,6 +257,20 @@ export class Sync {
|
||||
response, sessionState.lock, prepareTxn, log));
|
||||
|
||||
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);
|
||||
|
Loading…
Reference in New Issue
Block a user