Browse Source

feat: add url params: config.disableInviteFunctions, config.doNotStoreRoom and userInfo.displayName

master
Bettenbuk Zoltan 5 years ago
parent
commit
39d789a088

+ 2
- 0
react/features/base/config/configWhitelist.js View File

87
     'disableDeepLinking',
87
     'disableDeepLinking',
88
     'disableH264',
88
     'disableH264',
89
     'disableHPF',
89
     'disableHPF',
90
+    'disableInviteFunctions',
90
     'disableLocalVideoFlip',
91
     'disableLocalVideoFlip',
91
     'disableNS',
92
     'disableNS',
92
     'disableRemoteControl',
93
     'disableRemoteControl',
95
     'disableSuspendVideo',
96
     'disableSuspendVideo',
96
     'disableThirdPartyRequests',
97
     'disableThirdPartyRequests',
97
     'displayJids',
98
     'displayJids',
99
+    'doNotStoreRoom',
98
     'e2eping',
100
     'e2eping',
99
     'enableDisplayNameInStats',
101
     'enableDisplayNameInStats',
100
     'enableEmailInStats',
102
     'enableEmailInStats',

+ 4
- 2
react/features/base/settings/middleware.js View File

137
     const urlParams
137
     const urlParams
138
         = parseURLParams(getState()['features/base/connection'].locationURL);
138
         = parseURLParams(getState()['features/base/connection'].locationURL);
139
     const urlEmail = urlParams['userInfo.email'];
139
     const urlEmail = urlParams['userInfo.email'];
140
+    const urlDisplayName = urlParams['userInfo.displayName'];
140
 
141
 
141
-    if (!urlEmail) {
142
+    if (!urlEmail && !urlDisplayName) {
142
         return;
143
         return;
143
     }
144
     }
144
 
145
 
147
     if (localParticipant) {
148
     if (localParticipant) {
148
         dispatch(participantUpdated({
149
         dispatch(participantUpdated({
149
             ...localParticipant,
150
             ...localParticipant,
150
-            email: _.escape(urlEmail)
151
+            email: _.escape(urlEmail),
152
+            name: _.escape(urlDisplayName)
151
         }));
153
         }));
152
     }
154
     }
153
 }
155
 }

+ 27
- 17
react/features/conference/components/native/LonelyMeetingExperience.js View File

18
  */
18
  */
19
 type Props = {
19
 type Props = {
20
 
20
 
21
+    /**
22
+     * True if the invite functions (dial out, invite, share...etc) are disabled.
23
+     */
24
+    _isInviteFunctionsDiabled: boolean,
25
+
21
     /**
26
     /**
22
      * True if it's a lonely meeting (participant count excluding fakes is 1).
27
      * True if it's a lonely meeting (participant count excluding fakes is 1).
23
      */
28
      */
60
      * @inheritdoc
65
      * @inheritdoc
61
      */
66
      */
62
     render() {
67
     render() {
63
-        const { _isLonelyMeeting, _styles, t } = this.props;
68
+        const { _isInviteFunctionsDiabled, _isLonelyMeeting, _styles, t } = this.props;
64
 
69
 
65
         if (!_isLonelyMeeting) {
70
         if (!_isLonelyMeeting) {
66
             return null;
71
             return null;
75
                     ] }>
80
                     ] }>
76
                     { t('lonelyMeetingExperience.youAreAlone') }
81
                     { t('lonelyMeetingExperience.youAreAlone') }
77
                 </Text>
82
                 </Text>
78
-                <TouchableOpacity
79
-                    onPress = { this._onPress }
80
-                    style = { [
81
-                        styles.lonelyButton,
82
-                        _styles.lonelyButton
83
-                    ] }>
84
-                    <Icon
85
-                        size = { 24 }
86
-                        src = { IconAddPeople }
87
-                        style = { styles.lonelyButtonComponents } />
88
-                    <Text
83
+                { !_isInviteFunctionsDiabled && (
84
+                    <TouchableOpacity
85
+                        onPress = { this._onPress }
89
                         style = { [
86
                         style = { [
90
-                            styles.lonelyButtonComponents,
91
-                            _styles.lonelyMessage
87
+                            styles.lonelyButton,
88
+                            _styles.lonelyButton
92
                         ] }>
89
                         ] }>
93
-                        { t('lonelyMeetingExperience.button') }
94
-                    </Text>
95
-                </TouchableOpacity>
90
+                        <Icon
91
+                            size = { 24 }
92
+                            src = { IconAddPeople }
93
+                            style = { styles.lonelyButtonComponents } />
94
+                        <Text
95
+                            style = { [
96
+                                styles.lonelyButtonComponents,
97
+                                _styles.lonelyMessage
98
+                            ] }>
99
+                            { t('lonelyMeetingExperience.button') }
100
+                        </Text>
101
+                    </TouchableOpacity>
102
+                ) }
96
             </View>
103
             </View>
97
         );
104
         );
98
     }
105
     }
117
  * @returns {Props}
124
  * @returns {Props}
118
  */
125
  */
119
 function _mapStateToProps(state): $Shape<Props> {
126
 function _mapStateToProps(state): $Shape<Props> {
127
+    const { disableInviteFunctions } = state['features/base/config'];
128
+
120
     return {
129
     return {
130
+        _isInviteFunctionsDiabled: disableInviteFunctions,
121
         _isLonelyMeeting: getParticipantCount(state) === 1,
131
         _isLonelyMeeting: getParticipantCount(state) === 1,
122
         _styles: ColorSchemeRegistry.get(state, 'Conference')
132
         _styles: ColorSchemeRegistry.get(state, 'Conference')
123
     };
133
     };

+ 16
- 1
react/features/invite/components/add-people-dialog/native/InviteButton.js View File

38
     }
38
     }
39
 }
39
 }
40
 
40
 
41
+/**
42
+ * Maps part of the Redux state to the props of this component.
43
+ *
44
+ * @param {Object} state - The Redux state.
45
+ * @param {Props} ownProps - The own props of the component.
46
+ * @returns {Props}
47
+ */
48
+function _mapStateToProps(state, ownProps: Props) {
49
+    const { disableInviteFunctions } = state['features/base/config'];
50
+
51
+    return {
52
+        visible: !disableInviteFunctions && ownProps.visible
53
+    };
54
+}
55
+
41
 
56
 
42
-export default translate(connect()(InviteButton));
57
+export default translate(connect(_mapStateToProps)(InviteButton));

+ 27
- 21
react/features/recent-list/middleware.js View File

86
  * @returns {*} The result returned by {@code next(action)}.
86
  * @returns {*} The result returned by {@code next(action)}.
87
  */
87
  */
88
 function _conferenceWillLeave({ dispatch, getState }, next, action) {
88
 function _conferenceWillLeave({ dispatch, getState }, next, action) {
89
-    let locationURL;
90
-
91
-    /**
92
-     * FIXME:
93
-     * It is better to use action.conference[JITSI_CONFERENCE_URL_KEY]
94
-     * in order to make sure we get the url the conference is leaving
95
-     * from (i.e. the room we are leaving from) because if the order of events
96
-     * is different, we cannot be guranteed that the location URL in base
97
-     * connection is the url we are leaving from... not the one we are going to
98
-     * (the latter happens on mobile -- if we use the web implementation);
99
-     * however, the conference object on web does not have
100
-     * JITSI_CONFERENCE_URL_KEY so we cannot call it and must use the other way
101
-     */
102
-    if (typeof APP === 'undefined') {
103
-        locationURL = action.conference[JITSI_CONFERENCE_URL_KEY];
104
-    } else {
105
-        locationURL = getState()['features/base/connection'].locationURL;
89
+    const { doNotStoreRoom } = getState()['features/base/config'];
90
+
91
+    if (!doNotStoreRoom) {
92
+        let locationURL;
93
+
94
+        /**
95
+         * FIXME:
96
+         * It is better to use action.conference[JITSI_CONFERENCE_URL_KEY]
97
+         * in order to make sure we get the url the conference is leaving
98
+         * from (i.e. the room we are leaving from) because if the order of events
99
+         * is different, we cannot be guranteed that the location URL in base
100
+         * connection is the url we are leaving from... not the one we are going to
101
+         * (the latter happens on mobile -- if we use the web implementation);
102
+         * however, the conference object on web does not have
103
+         * JITSI_CONFERENCE_URL_KEY so we cannot call it and must use the other way
104
+         */
105
+        if (typeof APP === 'undefined') {
106
+            locationURL = action.conference[JITSI_CONFERENCE_URL_KEY];
107
+        } else {
108
+            locationURL = getState()['features/base/connection'].locationURL;
109
+        }
110
+        dispatch(
111
+            _updateConferenceDuration(
112
+                locationURL));
106
     }
113
     }
107
-    dispatch(
108
-        _updateConferenceDuration(
109
-            locationURL));
110
 
114
 
111
     return next(action);
115
     return next(action);
112
 }
116
 }
122
  * @returns {*} The result returned by {@code next(action)}.
126
  * @returns {*} The result returned by {@code next(action)}.
123
  */
127
  */
124
 function _setRoom({ dispatch, getState }, next, action) {
128
 function _setRoom({ dispatch, getState }, next, action) {
125
-    if (action.room) {
129
+    const { doNotStoreRoom } = getState()['features/base/config'];
130
+
131
+    if (!doNotStoreRoom && action.room) {
126
         const { locationURL } = getState()['features/base/connection'];
132
         const { locationURL } = getState()['features/base/connection'];
127
 
133
 
128
         if (locationURL) {
134
         if (locationURL) {

Loading…
Cancel
Save