From d65b25f08440c88008b8751b1edac7957fdf7ee9 Mon Sep 17 00:00:00 2001 From: Bruno Windels Date: Thu, 10 Feb 2022 20:00:01 +0100 Subject: [PATCH] also adjust m.direct if the room has already been replaced --- src/matrix/Session.js | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/matrix/Session.js b/src/matrix/Session.js index 287c48ea..778d2866 100644 --- a/src/matrix/Session.js +++ b/src/matrix/Session.js @@ -622,8 +622,10 @@ export class Session { await Promise.all(promises); // we should now know the roomId, check if the room was synced before we received // the room id. Replace the room being created with the synced room. - if (roomBeingCreated.roomId && !!this.rooms.get(roomBeingCreated.roomId)) { - this._tryReplaceRoomBeingCreated(roomBeingCreated.roomId, log); + if (roomBeingCreated.roomId) { + if (!!this.rooms.get(roomBeingCreated.roomId)) { + this._tryReplaceRoomBeingCreated(roomBeingCreated.roomId, log); + } await roomBeingCreated.adjustDirectMessageMapIfNeeded(this._user, this._storage, this._hsApi, log); } });