Ver código fonte

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

master
Bettenbuk Zoltan 5 anos atrás
pai
commit
39d789a088

+ 2
- 0
react/features/base/config/configWhitelist.js Ver arquivo

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

+ 4
- 2
react/features/base/settings/middleware.js Ver arquivo

@@ -137,8 +137,9 @@ function _updateLocalParticipantFromUrl({ dispatch, getState }) {
137 137
     const urlParams
138 138
         = parseURLParams(getState()['features/base/connection'].locationURL);
139 139
     const urlEmail = urlParams['userInfo.email'];
140
+    const urlDisplayName = urlParams['userInfo.displayName'];
140 141
 
141
-    if (!urlEmail) {
142
+    if (!urlEmail && !urlDisplayName) {
142 143
         return;
143 144
     }
144 145
 
@@ -147,7 +148,8 @@ function _updateLocalParticipantFromUrl({ dispatch, getState }) {
147 148
     if (localParticipant) {
148 149
         dispatch(participantUpdated({
149 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 Ver arquivo

@@ -18,6 +18,11 @@ import { Icon, IconAddPeople } from '../../../base/icons';
18 18
  */
19 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 27
      * True if it's a lonely meeting (participant count excluding fakes is 1).
23 28
      */
@@ -60,7 +65,7 @@ class LonelyMeetingExperience extends PureComponent<Props> {
60 65
      * @inheritdoc
61 66
      */
62 67
     render() {
63
-        const { _isLonelyMeeting, _styles, t } = this.props;
68
+        const { _isInviteFunctionsDiabled, _isLonelyMeeting, _styles, t } = this.props;
64 69
 
65 70
         if (!_isLonelyMeeting) {
66 71
             return null;
@@ -75,24 +80,26 @@ class LonelyMeetingExperience extends PureComponent<Props> {
75 80
                     ] }>
76 81
                     { t('lonelyMeetingExperience.youAreAlone') }
77 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 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 103
             </View>
97 104
         );
98 105
     }
@@ -117,7 +124,10 @@ class LonelyMeetingExperience extends PureComponent<Props> {
117 124
  * @returns {Props}
118 125
  */
119 126
 function _mapStateToProps(state): $Shape<Props> {
127
+    const { disableInviteFunctions } = state['features/base/config'];
128
+
120 129
     return {
130
+        _isInviteFunctionsDiabled: disableInviteFunctions,
121 131
         _isLonelyMeeting: getParticipantCount(state) === 1,
122 132
         _styles: ColorSchemeRegistry.get(state, 'Conference')
123 133
     };

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

@@ -38,5 +38,20 @@ class InviteButton extends AbstractButton<Props, *> {
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 Ver arquivo

@@ -86,27 +86,31 @@ function _appWillMount({ dispatch, getState }, next, action) {
86 86
  * @returns {*} The result returned by {@code next(action)}.
87 87
  */
88 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 115
     return next(action);
112 116
 }
@@ -122,7 +126,9 @@ function _conferenceWillLeave({ dispatch, getState }, next, action) {
122 126
  * @returns {*} The result returned by {@code next(action)}.
123 127
  */
124 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 132
         const { locationURL } = getState()['features/base/connection'];
127 133
 
128 134
         if (locationURL) {

Carregando…
Cancelar
Salvar