Use random widget IDs for video rooms (#8739)

This commit is contained in:
Robin 2022-06-02 09:10:22 -04:00 committed by GitHub
parent abfc66a34e
commit f152310c08
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
6 changed files with 15 additions and 17 deletions

View file

@ -35,16 +35,15 @@ interface IVideoChannelMemberContent {
devices: string[];
}
export const VIDEO_CHANNEL = "io.element.video";
export const VIDEO_CHANNEL_MEMBER = "io.element.video.member";
export const getVideoChannel = (roomId: string): IApp => {
const apps = WidgetStore.instance.getApps(roomId);
return apps.find(app => WidgetType.JITSI.matches(app.type) && app.id === VIDEO_CHANNEL);
return apps.find(app => WidgetType.JITSI.matches(app.type) && app.data.isVideoChannel);
};
export const addVideoChannel = async (roomId: string, roomName: string) => {
await WidgetUtils.addJitsiWidget(roomId, CallType.Video, "Video channel", VIDEO_CHANNEL, roomName);
await WidgetUtils.addJitsiWidget(roomId, CallType.Video, "Video channel", true, roomName);
};
export const getConnectedMembers = (room: Room, connectedLocalEcho: boolean): Set<RoomMember> => {