@@ -23,7 +23,7 @@ import { MatrixEvent } from "matrix-js-sdk/src/models/event";
2323import { logger } from "matrix-js-sdk/src/logger" ;
2424import { ClientEvent , RoomStateEvent } from "matrix-js-sdk/src/matrix" ;
2525import { CallType } from "matrix-js-sdk/src/webrtc/call" ;
26- import { randomLowercaseString , randomUppercaseString } from "matrix-js-sdk/src/randomstring" ;
26+ import { randomString , randomLowercaseString , randomUppercaseString } from "matrix-js-sdk/src/randomstring" ;
2727
2828import { MatrixClientPeg } from '../MatrixClientPeg' ;
2929import SdkConfig from "../SdkConfig" ;
@@ -35,7 +35,6 @@ import { Jitsi } from "../widgets/Jitsi";
3535import { objectClone } from "./objects" ;
3636import { _t } from "../languageHandler" ;
3737import { IApp } from "../stores/WidgetStore" ;
38- import { VIDEO_CHANNEL } from "./VideoChannelUtils" ;
3938
4039// How long we wait for the state event echo to come back from the server
4140// before waitFor[Room/User]Widget rejects its promise
@@ -444,11 +443,12 @@ export default class WidgetUtils {
444443 roomId : string ,
445444 type : CallType ,
446445 name : string ,
447- widgetId : string ,
446+ isVideoChannel : boolean ,
448447 oobRoomName ?: string ,
449448 ) : Promise < void > {
450449 const domain = Jitsi . getInstance ( ) . preferredDomain ;
451450 const auth = await Jitsi . getInstance ( ) . getJitsiAuth ( ) ;
451+ const widgetId = randomString ( 24 ) ; // Must be globally unique
452452
453453 let confId ;
454454 if ( auth === 'openidtoken-jwt' ) {
@@ -471,7 +471,7 @@ export default class WidgetUtils {
471471 conferenceId : confId ,
472472 roomName : oobRoomName ?? MatrixClientPeg . get ( ) . getRoom ( roomId ) ?. name ,
473473 isAudioOnly : type === CallType . Voice ,
474- isVideoChannel : widgetId === VIDEO_CHANNEL ,
474+ isVideoChannel,
475475 domain,
476476 auth,
477477 } ) ;
0 commit comments