diff --git a/connection.js b/connection.js index 1f8bd1df5..f4fadd5c1 100644 --- a/connection.js +++ b/connection.js @@ -106,9 +106,7 @@ export async function connect(id, password, roomName) { serviceUrl += `?room=${roomName}`; - // FIXME Remove deprecated 'bosh' option assignment at some point(LJM will be accepting only 'serviceUrl' option - // in future). It's included for the time being for Jitsi Meet and lib-jitsi-meet versions interoperability. - connectionConfig.serviceUrl = connectionConfig.bosh = serviceUrl; + connectionConfig.serviceUrl = serviceUrl; if (connectionConfig.websocketKeepAliveUrl) { connectionConfig.websocketKeepAliveUrl += `?room=${roomName}`; diff --git a/react/features/analytics/functions.js b/react/features/analytics/functions.js index d15f841e8..2769e77ad 100644 --- a/react/features/analytics/functions.js +++ b/react/features/analytics/functions.js @@ -181,7 +181,7 @@ export function initAnalytics({ getState }: { getState: Function }, handlers: Ar permanentProperties.appName = getAppName(); // Report if user is using websocket - permanentProperties.websocket = navigator.product !== 'ReactNative' && typeof config.websocket === 'string'; + permanentProperties.websocket = typeof config.websocket === 'string'; // Report if user is using the external API permanentProperties.externalApi = typeof API_ID === 'number'; diff --git a/react/features/base/connection/actions.native.js b/react/features/base/connection/actions.native.js index e227dbb75..0f6c50ac2 100644 --- a/react/features/base/connection/actions.native.js +++ b/react/features/base/connection/actions.native.js @@ -275,10 +275,11 @@ function _constructOptions(state) { // redux store. const options = _.cloneDeep(state['features/base/config']); - // Normalize the BOSH URL. let { bosh } = options; + const { websocket } = options; - if (bosh) { + // Normalize the BOSH URL. + if (bosh && !websocket) { const { locationURL } = state['features/base/connection']; if (bosh.startsWith('//')) { @@ -295,14 +296,22 @@ function _constructOptions(state) { // eslint-disable-next-line max-len bosh = `${protocol}//${host}${contextRoot || '/'}${bosh.substr(1)}`; } + } - // Append room to the URL's search. - const { room } = state['features/base/conference']; + // WebSocket is preferred over BOSH. + const serviceUrl = websocket || bosh; - room && (bosh += `?room=${getBackendSafeRoomName(room)}`); + // Append room to the URL's search. + const { room } = state['features/base/conference']; - // FIXME Remove deprecated 'bosh' option assignment at some point. - options.serviceUrl = options.bosh = bosh; + if (serviceUrl && room) { + const roomName = getBackendSafeRoomName(room); + + options.serviceUrl = `${serviceUrl}?room=${roomName}`; + + if (options.websocketKeepAliveUrl) { + options.websocketKeepAliveUrl += `?room=${roomName}`; + } } return options;