Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
config: drop configLocation and getroomnode options
Saúl Ibarra Corretgé1feff9709c8d
diff --git a/config.js b/config.jsindex d38dfbfa47..cd10908a6f 100644--- a/config.js+++ b/config.js@@ -1,16 +1,6 @@/* eslint-disable no-unused-vars, no-var */var config = {- // Configuration- //-- // Alternative location for the configuration.- // configLocation: './config.json',-- // Custom function which given the URL path should return a room name.- // getroomnode: function (path) { return 'someprefixpossiblybasedonpath'; },--// Connection//diff --git a/react/features/base/config/functions.any.js b/react/features/base/config/functions.any.jsindex 9cb964aa14..8f8894d4b6 100644--- a/react/features/base/config/functions.any.js+++ b/react/features/base/config/functions.any.js@@ -8,8 +8,6 @@ import INTERFACE_CONFIG_WHITELIST from './interfaceConfigWhitelist';import parseURLParams from './parseURLParams';import logger from './logger';-declare var $: Object;-// XXX The functions getRoomName and parseURLParams are split out of// functions.js because they are bundled in both app.bundle and// do_external_connect, webpack 1 does not support tree shaking, and we don't@@ -40,69 +38,6 @@ export function createFakeConfig(baseURL: string) {};}-/**- * Promise wrapper on obtain config method. When HttpConfigFetch will be moved- * to React app it's better to use load config instead.- *- * @param {string} location - URL of the domain from which the config is to be- * obtained.- * @param {string} room - Room name.- * @private- * @returns {Promise<void>}- */-export function obtainConfig(location: string, room: string): Promise<void> {- return new Promise((resolve, reject) =>- _obtainConfig(location, room, (success, error) => {- success ? resolve() : reject(error);- })- );-}--/**- * Sends HTTP POST request to specified {@code endpoint}. In request the name- * of the room is included in JSON format:- * {- * "rooomName": "someroom12345"- * }.- *- * @param {string} endpoint - The name of HTTP endpoint to which to send- * the HTTP POST request.- * @param {string} roomName - The name of the conference room for which config- * is requested.- * @param {Function} complete - The callback to invoke upon success or failure.- * @returns {void}- */-function _obtainConfig(endpoint: string, roomName: string, complete: Function) {- logger.info(`Send config request to ${endpoint} for room: ${roomName}`);- $.ajax(- endpoint,- {- contentType: 'application/json',- data: JSON.stringify({ roomName }),- dataType: 'json',- method: 'POST',-- error(jqXHR, textStatus, errorThrown) {- logger.error('Get config error: ', jqXHR, errorThrown);- complete(false, `Get config response status: ${textStatus}`);- },- success(data) {- const { config, interfaceConfig, loggingConfig } = window;-- try {- overrideConfigJSON(- config, interfaceConfig, loggingConfig,- data);- complete(true);- } catch (e) {- logger.error('Parse config error: ', e);- complete(false, e);- }- }- }- );-}-/* eslint-disable max-params, no-shadow *//**diff --git a/react/features/base/config/getRoomName.js b/react/features/base/config/getRoomName.jsindex 87254fd908..b787b6f7db 100644--- a/react/features/base/config/getRoomName.js+++ b/react/features/base/config/getRoomName.js@@ -1,29 +1,17 @@-/* @flow */+// @flowimport { getBackendSafeRoomName } from '../util';-declare var config: Object;-/*** Builds and returns the room name.** @returns {string}*/export default function getRoomName(): ?string {- const { getroomnode } = config;const path = window.location.pathname;- let roomName;- // Determine the room node from the URL.- if (getroomnode && typeof getroomnode === 'function') {- roomName = getroomnode.call(config, path);- } else {- // Fall back to the default strategy of making assumptions about how the- // URL maps to the room (name). It currently assumes a deployment in- // which the last non-directory component of the path (name) is the- // room.- roomName = path.substring(path.lastIndexOf('/') + 1) || undefined;- }+ // The last non-directory component of the path (name) is the room.+ const roomName = path.substring(path.lastIndexOf('/') + 1) || undefined;return getBackendSafeRoomName(roomName);}diff --git a/react/features/conference/components/web/Conference.js b/react/features/conference/components/web/Conference.jsindex b0ecf0f20b..93c888ec66 100644--- a/react/features/conference/components/web/Conference.js+++ b/react/features/conference/components/web/Conference.js@@ -5,7 +5,6 @@ import React from 'react';import VideoLayout from '../../../../../modules/UI/videolayout/VideoLayout';-import { obtainConfig } from '../../../base/config';import { connect, disconnect } from '../../../base/connection';import { translate } from '../../../base/i18n';import { connect as reactReduxConnect } from '../../../base/redux';@@ -23,7 +22,6 @@ import {} from '../../../toolbox';import { maybeShowSuboptimalExperienceNotification } from '../../functions';-import logger from '../../logger';import Labels from './Labels';import { default as Notice } from './Notice';@@ -123,31 +121,7 @@ class Conference extends AbstractConference<Props, *> {*/componentDidMount() {document.title = interfaceConfig.APP_NAME;-- const { configLocation } = config;-- if (configLocation) {- obtainConfig(configLocation, this.props._room)- .then(() => {- const now = window.performance.now();-- APP.connectionTimes['configuration.fetched'] = now;- logger.log('(TIME) configuration fetched:\t', now);-- this._start();- })- .catch(err => {- logger.log(err);-- // Show obtain config error.- APP.UI.messageHandler.showError({- descriptionKey: 'dialog.connectError',- titleKey: 'connection.CONNFAIL'- });- });- } else {- this._start();- }+ this._start();}/**