Merge pull request #5560 from matrix-org/dbkr/voip_user_mapper
Add VoIP user mapper
This commit is contained in:
commit
f703383ab6
7 changed files with 171 additions and 32 deletions
|
@ -16,6 +16,7 @@
|
|||
|
||||
import {Room} from "matrix-js-sdk/src/models/room";
|
||||
import { RoomListCustomisations } from "../../../customisations/RoomList";
|
||||
import { isVirtualRoom, voipUserMapperEnabled } from "../../../VoipUserMapper";
|
||||
|
||||
export class VisibilityProvider {
|
||||
private static internalInstance: VisibilityProvider;
|
||||
|
@ -31,18 +32,13 @@ export class VisibilityProvider {
|
|||
}
|
||||
|
||||
public isRoomVisible(room: Room): boolean {
|
||||
/* eslint-disable prefer-const */
|
||||
let isVisible = true; // Returned at the end of this function
|
||||
let forced = false; // When true, this function won't bother calling the customisation points
|
||||
/* eslint-enable prefer-const */
|
||||
|
||||
// ------
|
||||
// TODO: The `if` statements to control visibility of custom room types
|
||||
// would go here. The remainder of this function assumes that the statements
|
||||
// will be here.
|
||||
//
|
||||
// When removing this comment block, please remove the lint disable lines in the area.
|
||||
// ------
|
||||
if (voipUserMapperEnabled() && isVirtualRoom(room.roomId)) {
|
||||
isVisible = false;
|
||||
forced = true;
|
||||
}
|
||||
|
||||
const isVisibleFn = RoomListCustomisations.isRoomVisible;
|
||||
if (!forced && isVisibleFn) {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue