|
|
|
@ -1,4 +1,5 @@ |
|
|
|
|
import { IReduxState } from '../app/types'; |
|
|
|
|
import { IJitsiConference } from '../base/conference/reducer'; |
|
|
|
|
|
|
|
|
|
import { VPAAS_TENANT_PREFIX } from './constants'; |
|
|
|
|
import logger from './logger'; |
|
|
|
@ -47,6 +48,31 @@ export function isVpaasMeeting(state: IReduxState) { |
|
|
|
|
return false; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sends a request for retrieving the conference creator's customer id. |
|
|
|
|
* |
|
|
|
|
* @param {IJitsiConference} conference - The conference state. |
|
|
|
|
* @param {IReduxState} state - The state of the app. |
|
|
|
|
* @returns {Object} - Object containing customerId field. |
|
|
|
|
*/ |
|
|
|
|
export async function sendGetCustomerIdRequest(conference: IJitsiConference, state: IReduxState) { |
|
|
|
|
const { jaasConferenceCreatorUrl } = state['features/base/config']; |
|
|
|
|
|
|
|
|
|
const roomJid = conference?.room?.roomjid; |
|
|
|
|
|
|
|
|
|
if (jaasConferenceCreatorUrl && roomJid) { |
|
|
|
|
const fullUrl = `${jaasConferenceCreatorUrl}?conference=${encodeURIComponent(roomJid)}`; |
|
|
|
|
const response = await fetch(fullUrl); |
|
|
|
|
const responseBody = await response.json(); |
|
|
|
|
|
|
|
|
|
if (response.ok) { |
|
|
|
|
return responseBody; |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
logger.error(`Failed to fetch ${fullUrl}. with: ${JSON.stringify(responseBody)}`); |
|
|
|
|
} |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/** |
|
|
|
|
* Sends a request for retrieving jaas customer details. |
|
|
|
|
* |
|
|
|
|