瀏覽代碼

feat(config):InsecureRoomNameWarning config option

j8
Hristo Terezov 4 年之前
父節點
當前提交
f0c6e934ce

+ 2
- 1
react/features/conference/components/AbstractInsecureRoomNameLabel.js 查看文件

@@ -50,8 +50,9 @@ export default class AbstractInsecureRoomNameLabel extends PureComponent<Props>
50 50
  */
51 51
 export function _mapStateToProps(state: Object): $Shape<Props> {
52 52
     const { room } = state['features/base/conference'];
53
+    const { enableInsecureRoomNameWarning = false } = state['features/base/config'];
53 54
 
54 55
     return {
55
-        _visible: room && isInsecureRoomName(room)
56
+        _visible: enableInsecureRoomNameWarning && room && isInsecureRoomName(room)
56 57
     };
57 58
 }

+ 8
- 2
react/features/welcome/components/AbstractWelcomePage.js 查看文件

@@ -20,6 +20,11 @@ type Props = {
20 20
      */
21 21
     _calendarEnabled: boolean,
22 22
 
23
+    /**
24
+     * Whether the insecure room name functionality is enabled or not.
25
+     */
26
+    _enableInsecureRoomNameWarning: boolean,
27
+
23 28
     /**
24 29
      * Whether the recent list is enabled
25 30
      */
@@ -214,7 +219,7 @@ export class AbstractWelcomePage extends Component<Props, *> {
214 219
     _onRoomChange(value: string) {
215 220
         this.setState({
216 221
             room: value,
217
-            insecureRoomName: value && isInsecureRoomName(value)
222
+            insecureRoomName: this.props._enableInsecureRoomNameWarning && value && isInsecureRoomName(value)
218 223
         });
219 224
     }
220 225
 
@@ -226,7 +231,7 @@ export class AbstractWelcomePage extends Component<Props, *> {
226 231
      * @returns {ReactElement}
227 232
      */
228 233
     _renderInsecureRoomNameWarning() {
229
-        if (this.state.insecureRoomName) {
234
+        if (this.props._enableInsecureRoomNameWarning && this.state.insecureRoomName) {
230 235
             return this._doRenderInsecureRoomNameWarning();
231 236
         }
232 237
 
@@ -273,6 +278,7 @@ export class AbstractWelcomePage extends Component<Props, *> {
273 278
 export function _mapStateToProps(state: Object) {
274 279
     return {
275 280
         _calendarEnabled: isCalendarEnabled(state),
281
+        _enableInsecureRoomNameWarning: state['features/base/config'].enableInsecureRoomNameWarning || false,
276 282
         _recentListEnabled: isRecentListEnabled(),
277 283
         _room: state['features/base/conference'].room,
278 284
         _settings: state['features/base/settings']

Loading…
取消
儲存