Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

[RN] Simplify the source code

Lyubo Marinovf50a31b4e851
diff --git a/react/features/base/connection/actions.native.js b/react/features/base/connection/actions.native.js
index 016fce7ac3..d562ab20af 100644
--- a/react/features/base/connection/actions.native.js
+++ b/react/features/base/connection/actions.native.js
@@ -22,17 +22,16 @@ const JitsiConnectionEvents = JitsiMeetJS.events.connection;
export function connect() {
return (dispatch: Dispatch<*>, getState: Function) => {
const state = getState();
- const connectionOptions
- = state['features/base/connection'].connectionOptions;
- const room = state['features/base/conference'].room;
+ const { options } = state['features/base/connection'];
+ const { room } = state['features/base/conference'];
const connection
= new JitsiMeetJS.JitsiConnection(
- connectionOptions.appId,
- connectionOptions.token,
+ options.appId,
+ options.token,
{
- ...connectionOptions,
+ ...options,
bosh:
- connectionOptions.bosh
+ options.bosh
// XXX The Jitsi Meet deployments require the room
// argument to be in lower case at the time of this
diff --git a/react/features/base/connection/functions.js b/react/features/base/connection/functions.js
index b69daa7dc2..230df3049c 100644
--- a/react/features/base/connection/functions.js
+++ b/react/features/base/connection/functions.js
@@ -12,16 +12,16 @@ export function getDomain(stateOrGetState: Function | Object) {
= typeof stateOrGetState === 'function'
? stateOrGetState()
: stateOrGetState;
- const connection = state['features/base/connection'];
+ const { options } = state['features/base/connection'];
let domain;
try {
- domain = connection.connectionOptions.hosts.domain;
+ domain = options.hosts.domain;
} catch (e) {
- // XXX The value of connectionOptions or any of the properties
- // descending from it may be undefined at some point in the execution
- // (e.g. on start). Instead of multiple checks for the undefined value,
- // we just wrap it in a try-catch block.
+ // XXX The value of options or any of the properties descending from it
+ // may be undefined at some point in the execution (e.g. on start).
+ // Instead of multiple checks for the undefined value, we just wrap it
+ // in a try-catch block.
}
return domain;
diff --git a/react/features/base/connection/reducer.js b/react/features/base/connection/reducer.js
index 739587dc72..49bb5925cf 100644
--- a/react/features/base/connection/reducer.js
+++ b/react/features/base/connection/reducer.js
@@ -69,7 +69,7 @@ function _connectionEstablished(state: Object, action: Object) {
* @private
* @returns {Object}
*/
-function _constructConnectionOptions(domain: string) {
+function _constructOptions(domain: string) {
// FIXME The HTTPS scheme for the BOSH URL works with meet.jit.si on both
// mobile & Web. It also works with beta.meet.jit.si on Web. Unfortunately,
// it doesn't work with beta.meet.jit.si on mobile. Temporarily, use the
@@ -96,7 +96,9 @@ function _constructConnectionOptions(domain: string) {
bosh: `${String(boshProtocol)}//${domain}/http-bind`,
hosts: {
domain,
- focus: `focus.${domain}`,
+
+ // Required by:
+ // - lib-jitsi-meet/modules/xmpp/xmpp.js
muc: `conference.${domain}`
}
};
@@ -114,9 +116,9 @@ function _constructConnectionOptions(domain: string) {
function _setDomain(state: Object, action: Object) {
return {
...state,
- connectionOptions: {
- ...state.connectionOptions,
- ..._constructConnectionOptions(action.domain)
+ options: {
+ ...state.options,
+ ..._constructOptions(action.domain)
}
};
}