Browse Source

fix(vpaas) hide embed meeting for vpaas users

master
Tudor-Ovidiu Avram 4 years ago
parent
commit
ce4ef96941

+ 9
- 1
react/features/invite/components/add-people-dialog/web/AddPeopleDialog.js View File

@@ -10,6 +10,7 @@ import { translate } from '../../../../base/i18n';
10 10
 import { JitsiRecordingConstants } from '../../../../base/lib-jitsi-meet';
11 11
 import { getLocalParticipant } from '../../../../base/participants';
12 12
 import { connect } from '../../../../base/redux';
13
+import { isVpaasMeeting } from '../../../../billing-counter/functions';
13 14
 import EmbedMeetingTrigger from '../../../../embed-meeting/components/EmbedMeetingTrigger';
14 15
 import { getActiveSession } from '../../../../recording';
15 16
 import { updateDialInNumbers } from '../../../actions';
@@ -36,6 +37,11 @@ type Props = {
36 37
      */
37 38
     _dialIn: Object,
38 39
 
40
+    /**
41
+     * Whether or not embed meeting should be visible.
42
+     */
43
+    _embedMeetingVisible: boolean,
44
+
39 45
     /**
40 46
      * Whether or not invite contacts should be visible.
41 47
      */
@@ -80,6 +86,7 @@ type Props = {
80 86
 function AddPeopleDialog({
81 87
     _conferenceName,
82 88
     _dialIn,
89
+    _embedMeetingVisible,
83 90
     _inviteContactsVisible,
84 91
     _inviteUrl,
85 92
     _liveStreamViewURL,
@@ -152,7 +159,7 @@ function AddPeopleDialog({
152 159
                 <InviteByEmailSection
153 160
                     inviteSubject = { inviteSubject }
154 161
                     inviteText = { invite } />
155
-                <EmbedMeetingTrigger />
162
+                { _embedMeetingVisible && <EmbedMeetingTrigger /> }
156 163
                 <div className = 'invite-more-dialog separator' />
157 164
                 {
158 165
                     _liveStreamViewURL
@@ -191,6 +198,7 @@ function mapStateToProps(state) {
191 198
     return {
192 199
         _conferenceName: getRoomName(state),
193 200
         _dialIn: state['features/invite'],
201
+        _embedMeetingVisible: !isVpaasMeeting(state),
194 202
         _inviteContactsVisible: interfaceConfig.ENABLE_DIAL_OUT && !hideInviteContacts,
195 203
         _inviteUrl: getInviteURL(state),
196 204
         _liveStreamViewURL:

+ 17
- 1
react/features/toolbox/components/web/Toolbox.js View File

@@ -33,6 +33,7 @@ import {
33 33
 import { connect, equals } from '../../../base/redux';
34 34
 import { OverflowMenuItem } from '../../../base/toolbox/components';
35 35
 import { getLocalVideoTrack, toggleScreensharing } from '../../../base/tracks';
36
+import { isVpaasMeeting } from '../../../billing-counter/functions';
36 37
 import { VideoBlurButton } from '../../../blur';
37 38
 import { CHAT_SIZE, ChatCounter, toggleChat } from '../../../chat';
38 39
 import { EmbedMeetingDialog } from '../../../embed-meeting';
@@ -136,6 +137,11 @@ type Props = {
136 137
      */
137 138
     _isGuest: boolean,
138 139
 
140
+    /**
141
+     * Whether or not the current meeting belongs to a JaaS user.
142
+     */
143
+    _isVpaasMeeting: boolean,
144
+
139 145
     /**
140 146
      * The ID of the local participant.
141 147
      */
@@ -971,6 +977,15 @@ class Toolbox extends Component<Props, State> {
971 977
         );
972 978
     }
973 979
 
980
+    /**
981
+     * Returns true if the profile button is visible and false otherwise.
982
+     *
983
+     * @returns {boolean}
984
+     */
985
+    _isEmbedMeetingVisible() {
986
+        return !this.props._isVpaasMeeting && this._shouldShowButton('embedmeeting');
987
+    }
988
+
974 989
     /**
975 990
      * Returns true if the profile button is visible and false otherwise.
976 991
      *
@@ -1047,7 +1062,7 @@ class Toolbox extends Component<Props, State> {
1047 1062
                     key = 'stats'
1048 1063
                     onClick = { this._onToolbarOpenSpeakerStats }
1049 1064
                     text = { t('toolbar.speakerStats') } />,
1050
-            this._shouldShowButton('embedmeeting')
1065
+            this._isEmbedMeetingVisible()
1051 1066
                 && <OverflowMenuItem
1052 1067
                     accessibilityLabel = { t('toolbar.accessibilityLabel.embedMeeting') }
1053 1068
                     icon = { IconCodeBlock }
@@ -1433,6 +1448,7 @@ function _mapStateToProps(state) {
1433 1448
         _dialog: Boolean(state['features/base/dialog'].component),
1434 1449
         _feedbackConfigured: Boolean(callStatsID),
1435 1450
         _isGuest: state['features/base/jwt'].isGuest,
1451
+        _isVpaasMeeting: isVpaasMeeting(state),
1436 1452
         _fullScreen: fullScreen,
1437 1453
         _tileViewEnabled: shouldDisplayTileView(state),
1438 1454
         _localParticipantID: localParticipant.id,

Loading…
Cancel
Save