Переглянути джерело

feat(jwt) deprecate and remove enableFeaturesBasedOnToken

The new behavior is as follows:

IF a user has a token and `features` is not set, we treat it as if the
feature was enabled.

IF a user has a token and `features` is set, we check if the feature
name has a value of "true".

`isJwtFeatureEnabled` also provides a way to specify the default value
in case there is no token.
factor2
Saúl Ibarra Corretgé 3 роки тому
джерело
коміт
77d687952d

+ 0
- 3
config.js Переглянути файл

@@ -618,9 +618,6 @@ var config = {
618 618
     // Hides the email section under profile settings.
619 619
     // hideEmailInSettings: false,
620 620
 
621
-    // Whether or not some features are checked based on token.
622
-    // enableFeaturesBasedOnToken: false,
623
-
624 621
     // When enabled the password used for locking a room is restricted to up to the number of digits specified
625 622
     // default: roomPasswordNumberOfDigits: false,
626 623
     // roomPasswordNumberOfDigits: 10,

+ 0
- 3
lang/main.json Переглянути файл

@@ -11,7 +11,6 @@
11 11
         "defaultEmail": "Your Default Email",
12 12
         "disabled": "You can't invite people.",
13 13
         "failedToAdd": "Failed to add participants",
14
-        "footerText": "Dialing out is disabled.",
15 14
         "googleEmail": "Google Email",
16 15
         "inviteMoreHeader": "You are the only one in the meeting",
17 16
         "inviteMoreMailSubject": "Join {{appName}} meeting",
@@ -286,7 +285,6 @@
286 285
         "linkMeetingTitle": "Link meeting to Salesforce",
287 286
         "liveStreaming": "Live Streaming",
288 287
         "liveStreamingDisabledBecauseOfActiveRecordingTooltip": "Not possible while recording is active",
289
-        "liveStreamingDisabledTooltip": "Start live stream disabled.",
290 288
         "localUserControls": "Local user controls",
291 289
         "lockMessage": "Failed to lock the conference.",
292 290
         "lockRoom": "Add meeting $t(lockRoomPassword)",
@@ -341,7 +339,6 @@
341 339
         "recentlyUsedObjects": "Your recently used objects",
342 340
         "recording": "Recording",
343 341
         "recordingDisabledBecauseOfActiveLiveStreamingTooltip": "Not possible while a live stream is active",
344
-        "recordingDisabledTooltip": "Start recording disabled.",
345 342
         "rejoinNow": "Rejoin now",
346 343
         "remoteControlAllowedMessage": "{{user}} accepted your remote control request!",
347 344
         "remoteControlDeniedMessage": "{{user}} rejected your remote control request!",

+ 0
- 1
react/features/base/config/configType.ts Переглянути файл

@@ -260,7 +260,6 @@ export interface IConfig {
260 260
     enableDisplayNameInStats?: boolean;
261 261
     enableEmailInStats?: boolean;
262 262
     enableEncodedTransformSupport?: boolean;
263
-    enableFeaturesBasedOnToken?: boolean;
264 263
     enableForcedReload?: boolean;
265 264
     enableIceRestart?: boolean;
266 265
     enableInsecureRoomNameWarning?: boolean;

+ 26
- 0
react/features/base/jwt/functions.js Переглянути файл

@@ -2,6 +2,7 @@
2 2
 
3 3
 import jwtDecode from 'jwt-decode';
4 4
 
5
+import { getLocalParticipant } from '../participants/functions';
5 6
 import { parseURLParams } from '../util';
6 7
 
7 8
 import { MEET_FEATURES } from './constants';
@@ -31,6 +32,31 @@ export function getJwtName(state: Object) {
31 32
     return user?.name;
32 33
 }
33 34
 
35
+/**
36
+ * Check if the given JWT feature is enabled.
37
+ *
38
+ * @param {Object} state - The app state.
39
+ * @param {string} feature - The feature we want to check.
40
+ * @param {boolean} ifNoToken - Default value if there is no token.
41
+ * @returns {string}
42
+ */
43
+export function isJwtFeatureEnabled(state: Object, feature: string, ifNoToken: boolean = false) {
44
+    const { jwt } = state['features/base/jwt'];
45
+
46
+    if (!jwt) {
47
+        return ifNoToken;
48
+    }
49
+
50
+    const { features } = getLocalParticipant(state) || {};
51
+
52
+    // If `features` is undefined, act as if everything is enabled.
53
+    if (typeof features === 'undefined') {
54
+        return true;
55
+    }
56
+
57
+    return String(features[feature]) === 'true';
58
+}
59
+
34 60
 /**
35 61
  * Checks whether a given timestamp is a valid UNIX timestamp in seconds.
36 62
  * We convert to miliseconds during the check since `Date` works with miliseconds for UNIX timestamp values.

+ 0
- 11
react/features/base/participants/functions.ts Переглянути файл

@@ -402,17 +402,6 @@ export function getParticipantPresenceStatus(
402 402
     return participantById.presence;
403 403
 }
404 404
 
405
-/**
406
- * Returns true if there is at least 1 participant with screen sharing feature and false otherwise.
407
- *
408
- * @param {(Function|Object)} stateful - The (whole) redux state, or redux's
409
- * {@code getState} function to be used to retrieve the state.
410
- * @returns {boolean}
411
- */
412
-export function haveParticipantWithScreenSharingFeature(stateful: IStore | Function) {
413
-    return toState(stateful)['features/base/participants'].haveParticipantWithScreenSharingFeature;
414
-}
415
-
416 405
 /**
417 406
  * Selectors for getting all remote participants.
418 407
  *

+ 0
- 30
react/features/base/participants/reducer.ts Переглянути файл

@@ -101,7 +101,6 @@ const DEFAULT_STATE = {
101 101
     dominantSpeaker: undefined,
102 102
     everyoneIsModerator: false,
103 103
     fakeParticipants: new Map(),
104
-    haveParticipantWithScreenSharingFeature: false,
105 104
     local: undefined,
106 105
     localScreenShare: undefined,
107 106
     overwrittenNameList: {},
@@ -118,7 +117,6 @@ export interface IParticipantsState {
118 117
     dominantSpeaker?: string;
119 118
     everyoneIsModerator: boolean;
120 119
     fakeParticipants: Map<string, Participant>;
121
-    haveParticipantWithScreenSharingFeature: boolean;
122 120
     local?: LocalParticipant;
123 121
     localScreenShare?: Participant;
124 122
     overwrittenNameList: Object;
@@ -255,14 +253,6 @@ ReducerRegistry.register('features/base/participants', (state: IParticipantsStat
255 253
             } else if (!state.everyoneIsModerator && isModerator) {
256 254
                 state.everyoneIsModerator = _isEveryoneModerator(state);
257 255
             }
258
-
259
-            // haveParticipantWithScreenSharingFeature calculation:
260
-            const { features = {} } = participant;
261
-
262
-            // Currently we use only PARTICIPANT_UPDATED to set a feature to enabled and we never disable it.
263
-            if (String(features['screen-sharing']) === 'true') {
264
-                state.haveParticipantWithScreenSharingFeature = true;
265
-            }
266 256
         }
267 257
 
268 258
         return {
@@ -401,26 +391,6 @@ ReducerRegistry.register('features/base/participants', (state: IParticipantsStat
401 391
             state.everyoneIsModerator = _isEveryoneModerator(state);
402 392
         }
403 393
 
404
-        const { features = {} } = oldParticipant || {};
405
-
406
-        if (state.haveParticipantWithScreenSharingFeature && String(features['screen-sharing']) === 'true') {
407
-            const { features: localFeatures = {} } = state.local || {};
408
-
409
-            if (String(localFeatures['screen-sharing']) !== 'true') {
410
-                state.haveParticipantWithScreenSharingFeature = false;
411
-
412
-                // eslint-disable-next-line @typescript-eslint/no-unused-vars
413
-                for (const [ key, participant ] of state.remote) {
414
-                    const { features: f = {} } = participant;
415
-
416
-                    if (String(f['screen-sharing']) === 'true') {
417
-                        state.haveParticipantWithScreenSharingFeature = true;
418
-                        break;
419
-                    }
420
-                }
421
-            }
422
-        }
423
-
424 394
         if (dominantSpeaker === id) {
425 395
             state.dominantSpeaker = undefined;
426 396
         }

+ 1
- 49
react/features/invite/components/add-people-dialog/web/InviteContactsForm.js Переглянути файл

@@ -5,9 +5,8 @@ import React from 'react';
5 5
 import type { Dispatch } from 'redux';
6 6
 
7 7
 import { Avatar } from '../../../../base/avatar';
8
-import { translate, translateToHTML } from '../../../../base/i18n';
8
+import { translate } from '../../../../base/i18n';
9 9
 import { Icon, IconPhone } from '../../../../base/icons';
10
-import { getLocalParticipant } from '../../../../base/participants';
11 10
 import { MultiSelectAutocomplete } from '../../../../base/react';
12 11
 import { connect } from '../../../../base/redux';
13 12
 import { isVpaasMeeting } from '../../../../jaas/functions';
@@ -28,11 +27,6 @@ type Props = AbstractProps & {
28 27
      */
29 28
     _conference: Object,
30 29
 
31
-    /**
32
-     * Whether to show a footer text after the search results as a last element.
33
-     */
34
-    _footerTextEnabled: boolean,
35
-
36 30
     /**
37 31
      * Whether the meeting belongs to JaaS user.
38 32
      */
@@ -83,7 +77,6 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
83 77
         this._onSubmitKeyPress = this._onSubmitKeyPress.bind(this);
84 78
         this._parseQueryResults = this._parseQueryResults.bind(this);
85 79
         this._setMultiSelectElement = this._setMultiSelectElement.bind(this);
86
-        this._renderFooterText = this._renderFooterText.bind(this);
87 80
         this._onKeyDown = this._onKeyDown.bind(this);
88 81
 
89 82
         this._resourceClient = {
@@ -135,7 +128,6 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
135 128
             _sipInviteEnabled,
136 129
             t
137 130
         } = this.props;
138
-        const footerText = this._renderFooterText();
139 131
         let isMultiSelectDisabled = this.state.addToCallInProgress;
140 132
         const loadingMessage = 'addPeople.searching';
141 133
         const noMatches = 'addPeople.noResults';
@@ -163,7 +155,6 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
163 155
                 onKeyDown = { this._onKeyDown }>
164 156
                 { this._renderErrorMessage() }
165 157
                 <MultiSelectAutocomplete
166
-                    footer = { footerText }
167 158
                     isDisabled = { isMultiSelectDisabled }
168 159
                     loadingMessage = { t(loadingMessage) }
169 160
                     noMatchesFound = { t(noMatches) }
@@ -404,33 +395,6 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
404 395
 
405 396
     _query: (string) => Promise<Array<Object>>;
406 397
 
407
-    _renderFooterText: () => Object;
408
-
409
-    /**
410
-     * Sets up the rendering of the footer text, if enabled.
411
-     *
412
-     * @returns {Object | undefined}
413
-     */
414
-    _renderFooterText() {
415
-        const { _footerTextEnabled, t } = this.props;
416
-        let footerText;
417
-
418
-        if (_footerTextEnabled) {
419
-            footerText = {
420
-                content: <div className = 'footer-text-wrap'>
421
-                    <div>
422
-                        <span className = 'footer-telephone-icon'>
423
-                            <Icon src = { IconPhone } />
424
-                        </span>
425
-                    </div>
426
-                    { translateToHTML(t, 'addPeople.footerText') }
427
-                </div>
428
-            };
429
-        }
430
-
431
-        return footerText;
432
-    }
433
-
434 398
     _onClearItems: () => void;
435 399
 
436 400
     /**
@@ -580,20 +544,8 @@ class InviteContactsForm extends AbstractAddPeopleDialog<Props, State> {
580 544
  * @returns {Props}
581 545
  */
582 546
 function _mapStateToProps(state) {
583
-    const { enableFeaturesBasedOnToken } = state['features/base/config'];
584
-    let footerTextEnabled = false;
585
-
586
-    if (enableFeaturesBasedOnToken) {
587
-        const { features = {} } = getLocalParticipant(state);
588
-
589
-        if (String(features['outbound-call']) !== 'true') {
590
-            footerTextEnabled = true;
591
-        }
592
-    }
593
-
594 547
     return {
595 548
         ..._abstractMapStateToProps(state),
596
-        _footerTextEnabled: footerTextEnabled,
597 549
         _isVpaas: isVpaasMeeting(state)
598 550
     };
599 551
 }

+ 2
- 4
react/features/invite/functions.js Переглянути файл

@@ -5,6 +5,7 @@ import { getRoomName } from '../base/conference';
5 5
 import { getInviteURL } from '../base/connection';
6 6
 import { isIosMobileBrowser } from '../base/environment/utils';
7 7
 import { i18next } from '../base/i18n';
8
+import { isJwtFeatureEnabled } from '../base/jwt/functions';
8 9
 import { JitsiRecordingConstants } from '../base/lib-jitsi-meet';
9 10
 import { getLocalParticipant, isLocalParticipantModerator } from '../base/participants';
10 11
 import { toState } from '../base/redux';
@@ -410,11 +411,8 @@ export function isDialOutEnabled(state: Object): boolean {
410 411
  */
411 412
 export function isSipInviteEnabled(state: Object): boolean {
412 413
     const { sipInviteUrl } = state['features/base/config'];
413
-    const { features = {} } = getLocalParticipant(state) || {};
414 414
 
415
-    return state['features/base/jwt'].jwt
416
-        && Boolean(sipInviteUrl)
417
-        && String(features['sip-outbound-call']) === 'true';
415
+    return isJwtFeatureEnabled(state, 'sip-outbound-call') && Boolean(sipInviteUrl);
418 416
 }
419 417
 
420 418
 /**

+ 7
- 24
react/features/recording/components/LiveStream/AbstractLiveStreamButton.js Переглянути файл

@@ -1,11 +1,9 @@
1 1
 // @flow
2 2
 
3 3
 import { IconLiveStreaming } from '../../../base/icons';
4
+import { isJwtFeatureEnabled } from '../../../base/jwt/functions';
4 5
 import { JitsiRecordingConstants } from '../../../base/lib-jitsi-meet';
5
-import {
6
-    getLocalParticipant,
7
-    isLocalParticipantModerator
8
-} from '../../../base/participants';
6
+import { isLocalParticipantModerator } from '../../../base/participants';
9 7
 import { AbstractButton, type AbstractButtonProps } from '../../../base/toolbox/components';
10 8
 import { isInBreakoutRoom } from '../../../breakout-rooms/functions';
11 9
 import { maybeShowPremiumFeatureDialog } from '../../../jaas/actions';
@@ -134,36 +132,22 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
134 132
 
135 133
     // A button can be disabled/enabled only if enableFeaturesBasedOnToken
136 134
     // is on or if the recording is running.
137
-    let _disabled;
135
+    let _disabled = false;
138 136
     let _tooltip = '';
139 137
 
140 138
     if (typeof visible === 'undefined') {
141 139
         // If the containing component provides the visible prop, that is one
142
-        // above all, but if not, the button should be autonomus and decide on
140
+        // above all, but if not, the button should be autonomous and decide on
143 141
         // its own to be visible or not.
144 142
         const isModerator = isLocalParticipantModerator(state);
145
-        const {
146
-            enableFeaturesBasedOnToken
147
-        } = state['features/base/config'];
148 143
         const liveStreaming = getLiveStreaming(state);
149
-        const { features = {} } = getLocalParticipant(state);
150 144
 
151 145
         visible = isModerator && liveStreaming.enabled;
152
-
153
-        if (enableFeaturesBasedOnToken) {
154
-            visible = visible && String(features.livestreaming) === 'true';
155
-            _disabled = String(features.livestreaming) === 'disabled';
156
-
157
-            if (!visible && !_disabled) {
158
-                _disabled = true;
159
-                visible = true;
160
-                _tooltip = 'dialog.liveStreamingDisabledTooltip';
161
-            }
162
-        }
146
+        visible = isJwtFeatureEnabled(state, 'livestreaming', visible);
163 147
     }
164 148
 
165 149
     // disable the button if the recording is running.
166
-    if (getActiveSession(state, JitsiRecordingConstants.mode.FILE)) {
150
+    if (visible && getActiveSession(state, JitsiRecordingConstants.mode.FILE)) {
167 151
         _disabled = true;
168 152
         _tooltip = 'dialog.liveStreamingDisabledBecauseOfActiveRecordingTooltip';
169 153
     }
@@ -176,8 +160,7 @@ export function _mapStateToProps(state: Object, ownProps: Props) {
176 160
 
177 161
     return {
178 162
         _disabled,
179
-        _isLiveStreamRunning: Boolean(
180
-            getActiveSession(state, JitsiRecordingConstants.mode.STREAM)),
163
+        _isLiveStreamRunning: Boolean(getActiveSession(state, JitsiRecordingConstants.mode.STREAM)),
181 164
         _tooltip,
182 165
         visible
183 166
     };

+ 4
- 14
react/features/recording/functions.js Переглянути файл

@@ -1,6 +1,7 @@
1 1
 // @flow
2 2
 
3 3
 import { isMobileBrowser } from '../base/environment/utils';
4
+import { isJwtFeatureEnabled } from '../base/jwt/functions';
4 5
 import { JitsiRecordingConstants, browser } from '../base/lib-jitsi-meet';
5 6
 import { getLocalParticipant, getRemoteParticipants, isLocalParticipantModerator } from '../base/participants';
6 7
 import { isInBreakoutRoom } from '../breakout-rooms/functions';
@@ -153,7 +154,7 @@ export function getRecordButtonProps(state: Object): ?string {
153 154
 
154 155
     // a button can be disabled/enabled if enableFeaturesBasedOnToken
155 156
     // is on or if the livestreaming is running.
156
-    let disabled;
157
+    let disabled = false;
157 158
     let tooltip = '';
158 159
 
159 160
     // If the containing component provides the visible prop, that is one
@@ -161,29 +162,18 @@ export function getRecordButtonProps(state: Object): ?string {
161 162
     // its own to be visible or not.
162 163
     const isModerator = isLocalParticipantModerator(state);
163 164
     const {
164
-        enableFeaturesBasedOnToken,
165 165
         recordingService,
166 166
         localRecording
167 167
     } = state['features/base/config'];
168
-    const { features = {} } = getLocalParticipant(state);
169 168
     const localRecordingEnabled = !localRecording?.disable && supportsLocalRecording();
170 169
 
171 170
     const dropboxEnabled = isDropboxEnabled(state);
172 171
 
173 172
     visible = isModerator && (recordingService?.enabled || localRecordingEnabled || dropboxEnabled);
174
-
175
-    if (enableFeaturesBasedOnToken) {
176
-        visible = visible && String(features.recording) === 'true';
177
-        disabled = String(features.recording) === 'disabled';
178
-        if (!visible && !disabled) {
179
-            disabled = true;
180
-            visible = true;
181
-            tooltip = 'dialog.recordingDisabledTooltip';
182
-        }
183
-    }
173
+    visible = isJwtFeatureEnabled(state, 'recording', visible);
184 174
 
185 175
     // disable the button if the livestreaming is running.
186
-    if (getActiveSession(state, JitsiRecordingConstants.mode.STREAM)) {
176
+    if (visible && getActiveSession(state, JitsiRecordingConstants.mode.STREAM)) {
187 177
         disabled = true;
188 178
         tooltip = 'dialog.recordingDisabledBecauseOfActiveLiveStreamingTooltip';
189 179
     }

+ 8
- 25
react/features/toolbox/components/web/ShareDesktopButton.js Переглянути файл

@@ -10,26 +10,20 @@ import { isDesktopShareButtonDisabled } from '../../functions';
10 10
 
11 11
 type Props = AbstractButtonProps & {
12 12
 
13
-     /**
14
-     * Whether or not screensharing is initialized.
15
-     */
16
-      _desktopSharingEnabled: boolean,
17
-
18 13
     /**
19
-     * The tooltip key to use when screensharing is disabled. Or undefined
20
-     * if non to be shown and the button to be hidden.
14
+     * Whether or not screensharing is initialized.
21 15
      */
22
-    _desktopSharingDisabledTooltipKey: string,
16
+    _desktopSharingEnabled: boolean,
23 17
 
24 18
     /**
25 19
      * Whether or not the local participant is screensharing.
26 20
      */
27
-     _screensharing: boolean,
21
+    _screensharing: boolean,
28 22
 
29 23
     /**
30 24
      * The redux {@code dispatch} function.
31 25
      */
32
-     dispatch: Function,
26
+    dispatch: Function,
33 27
 };
34 28
 
35 29
 /**
@@ -46,7 +40,7 @@ class ShareDesktopButton extends AbstractButton<Props, *> {
46 40
      * Retrieves tooltip dynamically.
47 41
      */
48 42
     get tooltip() {
49
-        const { _desktopSharingDisabledTooltipKey, _desktopSharingEnabled, _screensharing } = this.props;
43
+        const { _desktopSharingEnabled, _screensharing } = this.props;
50 44
 
51 45
         if (_desktopSharingEnabled) {
52 46
             if (_screensharing) {
@@ -56,7 +50,7 @@ class ShareDesktopButton extends AbstractButton<Props, *> {
56 50
             return 'toolbar.startScreenSharing';
57 51
         }
58 52
 
59
-        return _desktopSharingDisabledTooltipKey;
53
+        return 'dialog.shareYourScreenDisabled';
60 54
     }
61 55
 
62 56
     /**
@@ -98,23 +92,12 @@ class ShareDesktopButton extends AbstractButton<Props, *> {
98 92
  * @returns {Object}
99 93
  */
100 94
 const mapStateToProps = state => {
101
-    let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
102
-    const { enableFeaturesBasedOnToken } = state['features/base/config'];
103
-    let desktopSharingDisabledTooltipKey;
104
-
105
-    if (enableFeaturesBasedOnToken) {
106
-        // we enable desktop sharing if any participant already have this
107
-        // feature enabled
108
-        desktopSharingEnabled = state['features/base/participants'].haveParticipantWithScreenSharingFeature;
109
-        desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
110
-    }
111
-
112 95
     // Disable the screenshare button if the video sender limit is reached and there is no video or media share in
113 96
     // progress.
114
-    desktopSharingEnabled = desktopSharingEnabled && !isDesktopShareButtonDisabled(state);
97
+    const desktopSharingEnabled
98
+        = JitsiMeetJS.isDesktopSharingEnabled() && !isDesktopShareButtonDisabled(state);
115 99
 
116 100
     return {
117
-        _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
118 101
         _desktopSharingEnabled: desktopSharingEnabled,
119 102
         _screensharing: isScreenVideoShared(state)
120 103
     };

+ 2
- 29
react/features/toolbox/components/web/Toolbox.js Переглянути файл

@@ -21,7 +21,6 @@ import JitsiMeetJS from '../../../base/lib-jitsi-meet';
21 21
 import {
22 22
     getLocalParticipant,
23 23
     hasRaisedHand,
24
-    haveParticipantWithScreenSharingFeature,
25 24
     raiseHand
26 25
 } from '../../../base/participants';
27 26
 import { connect } from '../../../base/redux';
@@ -133,12 +132,6 @@ type Props = {
133 132
      */
134 133
     _desktopSharingButtonDisabled: boolean,
135 134
 
136
-    /**
137
-     * The tooltip key to use when screensharing is disabled. Or undefined
138
-     * if non to be shown and the button to be hidden.
139
-     */
140
-    _desktopSharingDisabledTooltipKey: boolean,
141
-
142 135
     /**
143 136
      * Whether or not screensharing is initialized.
144 137
      */
@@ -1274,12 +1267,7 @@ class Toolbox extends Component<Props> {
1274 1267
      * @returns {boolean}
1275 1268
      */
1276 1269
     _showDesktopSharingButton() {
1277
-        const {
1278
-            _desktopSharingEnabled,
1279
-            _desktopSharingDisabledTooltipKey
1280
-        } = this.props;
1281
-
1282
-        return _desktopSharingEnabled || _desktopSharingDisabledTooltipKey;
1270
+        return this.props._desktopSharingEnabled;
1283 1271
     }
1284 1272
 
1285 1273
     /**
@@ -1408,12 +1396,10 @@ class Toolbox extends Component<Props> {
1408 1396
  */
1409 1397
 function _mapStateToProps(state, ownProps) {
1410 1398
     const { conference } = state['features/base/conference'];
1411
-    let desktopSharingEnabled = JitsiMeetJS.isDesktopSharingEnabled();
1412 1399
     const {
1413 1400
         buttonsWithNotifyClick,
1414 1401
         callStatsID,
1415 1402
         disableProfile,
1416
-        enableFeaturesBasedOnToken,
1417 1403
         iAmRecorder,
1418 1404
         iAmSipGateway
1419 1405
     } = state['features/base/config'];
@@ -1425,18 +1411,6 @@ function _mapStateToProps(state, ownProps) {
1425 1411
     const localParticipant = getLocalParticipant(state);
1426 1412
     const localVideo = getLocalVideoTrack(state['features/base/tracks']);
1427 1413
     const { clientWidth } = state['features/base/responsive-ui'];
1428
-
1429
-    let desktopSharingDisabledTooltipKey;
1430
-
1431
-    if (enableFeaturesBasedOnToken) {
1432
-        if (desktopSharingEnabled) {
1433
-            // we enable desktop sharing if any participant already have this
1434
-            // feature enabled and if the user supports it.
1435
-            desktopSharingEnabled = haveParticipantWithScreenSharingFeature(state);
1436
-            desktopSharingDisabledTooltipKey = 'dialog.shareYourScreenDisabled';
1437
-        }
1438
-    }
1439
-
1440 1414
     const toolbarButtons = ownProps.toolbarButtons || getToolbarButtons(state);
1441 1415
 
1442 1416
     return {
@@ -1445,9 +1419,8 @@ function _mapStateToProps(state, ownProps) {
1445 1419
         _chatOpen: state['features/chat'].isOpen,
1446 1420
         _clientWidth: clientWidth,
1447 1421
         _conference: conference,
1448
-        _desktopSharingEnabled: desktopSharingEnabled,
1422
+        _desktopSharingEnabled: JitsiMeetJS.isDesktopSharingEnabled(),
1449 1423
         _desktopSharingButtonDisabled: isDesktopShareButtonDisabled(state),
1450
-        _desktopSharingDisabledTooltipKey: desktopSharingDisabledTooltipKey,
1451 1424
         _dialog: Boolean(state['features/base/dialog'].component),
1452 1425
         _disabled: Boolean(iAmRecorder || iAmSipGateway),
1453 1426
         _feedbackConfigured: Boolean(callStatsID),

Завантаження…
Відмінити
Зберегти