diff --git a/src/stores/room-list/RoomListStore.ts b/src/stores/room-list/RoomListStore.ts index 15e385f7e4..a050442eae 100644 --- a/src/stores/room-list/RoomListStore.ts +++ b/src/stores/room-list/RoomListStore.ts @@ -426,12 +426,12 @@ export class RoomListStoreClass extends AsyncStoreWithClient { this.roomHoldingPen.push(room); return; } else { - // we call straight out to VoipUserMapper here which is a bit of a hack: probably this - // should be calling the visibility provider which in turn farms out to various visibility - // providers? Anyway, the point of this is that we delay doing anything about this room - // until the VoipUserMapper had had a chance to do the things it needs to do to decide - // if we should show this room or not. - await VoipUserMapper.sharedInstance().onNewInvitedRoom(room); + // Let the visibility provider know that there is a new invited room. It would be nice + // if this could just be an event that things listen for but the point of this is that + // we delay doing anything about this room until the VoipUserMapper had had a chance + // to do the things it needs to do to decide if we should show this room or not, so + // an even wouldn't et us do that. + await VisibilityProvider.instance.onNewInvitedRoom(room); } } diff --git a/src/stores/room-list/filters/VisibilityProvider.ts b/src/stores/room-list/filters/VisibilityProvider.ts index 45233357c1..2239f9e1ac 100644 --- a/src/stores/room-list/filters/VisibilityProvider.ts +++ b/src/stores/room-list/filters/VisibilityProvider.ts @@ -32,6 +32,10 @@ export class VisibilityProvider { return VisibilityProvider.internalInstance; } + public async onNewInvitedRoom(room: Room) { + await VoipUserMapper.sharedInstance().onNewInvitedRoom(room); + } + public isRoomVisible(room: Room): boolean { let isVisible = true; // Returned at the end of this function let forced = false; // When true, this function won't bother calling the customisation points