From f0c6e934ce8fb4bee75ae2061b920eb703cf688f Mon Sep 17 00:00:00 2001 From: Hristo Terezov Date: Wed, 27 May 2020 17:12:06 -0500 Subject: [PATCH] feat(config):InsecureRoomNameWarning config option --- .../components/AbstractInsecureRoomNameLabel.js | 3 ++- .../features/welcome/components/AbstractWelcomePage.js | 10 ++++++++-- 2 files changed, 10 insertions(+), 3 deletions(-) diff --git a/react/features/conference/components/AbstractInsecureRoomNameLabel.js b/react/features/conference/components/AbstractInsecureRoomNameLabel.js index c5902790df..5bcd446e2d 100644 --- a/react/features/conference/components/AbstractInsecureRoomNameLabel.js +++ b/react/features/conference/components/AbstractInsecureRoomNameLabel.js @@ -50,8 +50,9 @@ export default class AbstractInsecureRoomNameLabel extends PureComponent */ export function _mapStateToProps(state: Object): $Shape { const { room } = state['features/base/conference']; + const { enableInsecureRoomNameWarning = false } = state['features/base/config']; return { - _visible: room && isInsecureRoomName(room) + _visible: enableInsecureRoomNameWarning && room && isInsecureRoomName(room) }; } diff --git a/react/features/welcome/components/AbstractWelcomePage.js b/react/features/welcome/components/AbstractWelcomePage.js index b8e5f1136c..acd4a7f183 100644 --- a/react/features/welcome/components/AbstractWelcomePage.js +++ b/react/features/welcome/components/AbstractWelcomePage.js @@ -20,6 +20,11 @@ type Props = { */ _calendarEnabled: boolean, + /** + * Whether the insecure room name functionality is enabled or not. + */ + _enableInsecureRoomNameWarning: boolean, + /** * Whether the recent list is enabled */ @@ -214,7 +219,7 @@ export class AbstractWelcomePage extends Component { _onRoomChange(value: string) { this.setState({ room: value, - insecureRoomName: value && isInsecureRoomName(value) + insecureRoomName: this.props._enableInsecureRoomNameWarning && value && isInsecureRoomName(value) }); } @@ -226,7 +231,7 @@ export class AbstractWelcomePage extends Component { * @returns {ReactElement} */ _renderInsecureRoomNameWarning() { - if (this.state.insecureRoomName) { + if (this.props._enableInsecureRoomNameWarning && this.state.insecureRoomName) { return this._doRenderInsecureRoomNameWarning(); } @@ -273,6 +278,7 @@ export class AbstractWelcomePage extends Component { export function _mapStateToProps(state: Object) { return { _calendarEnabled: isCalendarEnabled(state), + _enableInsecureRoomNameWarning: state['features/base/config'].enableInsecureRoomNameWarning || false, _recentListEnabled: isRecentListEnabled(), _room: state['features/base/conference'].room, _settings: state['features/base/settings']