Sfoglia il codice sorgente

feat: private message interface config flag

master
Bettenbuk Zoltan 6 anni fa
parent
commit
53f01a39c9

+ 1
- 0
react/features/base/config/interfaceConfigWhitelist.js Vedi File

22
     'DEFAULT_REMOTE_DISPLAY_NAME',
22
     'DEFAULT_REMOTE_DISPLAY_NAME',
23
     'DISABLE_DOMINANT_SPEAKER_INDICATOR',
23
     'DISABLE_DOMINANT_SPEAKER_INDICATOR',
24
     'DISABLE_FOCUS_INDICATOR',
24
     'DISABLE_FOCUS_INDICATOR',
25
+    'DISABLE_PRIVATE_MESSAGES',
25
     'DISABLE_RINGING',
26
     'DISABLE_RINGING',
26
     'DISABLE_TRANSCRIPTION_SUBTITLES',
27
     'DISABLE_TRANSCRIPTION_SUBTITLES',
27
     'DISABLE_VIDEO_BACKGROUND',
28
     'DISABLE_VIDEO_BACKGROUND',

+ 36
- 2
react/features/remote-video-menu/components/web/PrivateMessageMenuButton.js Vedi File

5
 import { translate } from '../../../base/i18n';
5
 import { translate } from '../../../base/i18n';
6
 import { IconMessage } from '../../../base/icons';
6
 import { IconMessage } from '../../../base/icons';
7
 import { connect } from '../../../base/redux';
7
 import { connect } from '../../../base/redux';
8
-import { _mapDispatchToProps, _mapStateToProps, type Props } from '../../../chat/components/PrivateMessageButton';
8
+import {
9
+    _mapDispatchToProps,
10
+    _mapStateToProps as _abstractMapStateToProps,
11
+    type Props as AbstractProps
12
+} from '../../../chat/components/PrivateMessageButton';
13
+import { isButtonEnabled } from '../../../toolbox';
9
 
14
 
10
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
15
 import RemoteVideoMenuButton from './RemoteVideoMenuButton';
11
 
16
 
17
+declare var interfaceConfig: Object;
18
+
19
+type Props = AbstractProps & {
20
+
21
+    /**
22
+     * True if the private chat functionality is disabled, hence the button is not visible.
23
+     */
24
+    _hidden: boolean
25
+};
26
+
12
 /**
27
 /**
13
  * A custom implementation of the PrivateMessageButton specialized for
28
  * A custom implementation of the PrivateMessageButton specialized for
14
  * the web version of the remote video menu. When the web platform starts to use
29
  * the web version of the remote video menu. When the web platform starts to use
34
      * @returns {ReactElement}
49
      * @returns {ReactElement}
35
      */
50
      */
36
     render() {
51
     render() {
37
-        const { participantID, t } = this.props;
52
+        const { participantID, t, _hidden } = this.props;
53
+
54
+        if (_hidden) {
55
+            return null;
56
+        }
38
 
57
 
39
         return (
58
         return (
40
             <RemoteVideoMenuButton
59
             <RemoteVideoMenuButton
59
     }
78
     }
60
 }
79
 }
61
 
80
 
81
+/**
82
+ * Maps part of the Redux store to the props of this component.
83
+ *
84
+ * @param {Object} state - The Redux state.
85
+ * @param {Props} ownProps - The own props of the component.
86
+ * @returns {Props}
87
+ */
88
+function _mapStateToProps(state: Object, ownProps: Props): $Shape<Props> {
89
+    return {
90
+        ..._abstractMapStateToProps(state, ownProps),
91
+        _hidden: typeof interfaceConfig !== 'undefined'
92
+            && (interfaceConfig.DISABLE_PRIVATE_MESSAGES || !isButtonEnabled('chat'))
93
+    };
94
+}
95
+
62
 export default translate(connect(_mapStateToProps, _mapDispatchToProps)(PrivateMessageMenuButton));
96
 export default translate(connect(_mapStateToProps, _mapDispatchToProps)(PrivateMessageMenuButton));

Loading…
Annulla
Salva