Correctly template in Jitsi widget auth if such exists

Also add roomId to the widget data and URL template. It's needed by
the Element Web Jitsi code to produce auth for the Jitsi backend.
This commit is contained in:
Jason Robinson 2020-09-04 12:42:46 +03:00
parent a511ad6633
commit baa6d8a294
3 changed files with 19 additions and 7 deletions

View file

@ -448,16 +448,21 @@ export default class WidgetUtils {
return encodeURIComponent(`${widgetLocation}::${widgetUrl}`);
}
static getLocalJitsiWrapperUrl(opts: {forLocalRender?: boolean}={}) {
static getLocalJitsiWrapperUrl(opts: {forLocalRender?: boolean, auth?: string}={}) {
// NB. we can't just encodeURIComponent all of these because the $ signs need to be there
const queryString = [
const queryParts = [
'conferenceDomain=$domain',
'conferenceId=$conferenceId',
'isAudioOnly=$isAudioOnly',
'displayName=$matrix_display_name',
'avatarUrl=$matrix_avatar_url',
'userId=$matrix_user_id',
].join('&');
'roomId=$matrix_room_id',
];
if (opts.auth) {
queryParts.push(`auth=${opts.auth}`);
}
const queryString = queryParts.join('&');
let baseUrl = window.location;
if (window.location.protocol !== "https:" && !opts.forLocalRender) {