Send onNewInvitedRoom via VisibilityProvider

This commit is contained in:
David Baker 2021-02-15 18:13:13 +00:00
parent d339dc447f
commit 89b2dae035
2 changed files with 10 additions and 6 deletions

View file

@ -426,12 +426,12 @@ export class RoomListStoreClass extends AsyncStoreWithClient<IState> {
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);
}
}

View file

@ -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