瀏覽代碼

fix(av-moderation,breakout-rooms) disable controls on breakout rooms

AV moderation does not work on brerakout rooms.

Since some of the options in the "breakoutRooms" config section no
longer apply, I moved the relevant ones to a new "participantsPane"
section.
master
Saúl Ibarra Corretgé 3 年之前
父節點
當前提交
ffa55cca1e

+ 11
- 9
config.js 查看文件

@@ -1108,22 +1108,24 @@ var config = {
1108 1108
     */
1109 1109
     // dynamicBrandingUrl: '',
1110 1110
 
1111
+    // Options related to the participants pane.
1112
+    // participantsPane: {
1113
+    //     // Hides the moderator settings tab.
1114
+    //     hideModeratorSettingsTab: false,
1115
+    //     // Hides the more actions button.
1116
+    //     hideMoreActionsButton: false,
1117
+    //     // Hides the mute all button.
1118
+    //     hideMuteAllButton: false
1119
+    // },
1120
+
1111 1121
     // Options related to the breakout rooms feature.
1112 1122
     // breakoutRooms: {
1113 1123
     //     // Hides the add breakout room button. This replaces `hideAddRoomButton`.
1114 1124
     //     hideAddRoomButton: false,
1115 1125
     //     // Hides the auto assign participants button.
1116 1126
     //     hideAutoAssignButton: false,
1117
-    //     // Hides the participants pane footer menu.
1118
-    //     hideFooterMenu: false,
1119 1127
     //     // Hides the join breakout room button.
1120
-    //     hideJoinRoomButton: false,
1121
-    //     // Hides the moderator settings tab.
1122
-    //     hideModeratorSettingsTab: false,
1123
-    //     // Hides the more actions button.
1124
-    //     hideMoreActionsButton: false,
1125
-    //     // Hides the mute all button.
1126
-    //     hideMuteAllButton: false
1128
+    //     hideJoinRoomButton: false
1127 1129
     // },
1128 1130
 
1129 1131
     // When true the user cannot add more images to be used as virtual background.

+ 1
- 0
react/features/base/config/configWhitelist.js 查看文件

@@ -192,6 +192,7 @@ export default [
192 192
     'openSharedDocumentOnJoin',
193 193
     'opusMaxAverageBitrate',
194 194
     'p2p',
195
+    'participantsPane',
195 196
     'pcStatsInterval',
196 197
     'preferH264',
197 198
     'preferredCodec',

+ 2
- 3
react/features/participants-pane/components/native/ParticipantsPane.js 查看文件

@@ -20,7 +20,7 @@ import {
20 20
 import { getKnockingParticipants } from '../../../lobby/functions';
21 21
 import MuteEveryoneDialog
22 22
     from '../../../video-menu/components/native/MuteEveryoneDialog';
23
-import { isFooterMenuVisible, isMoreActionsVisible, isMuteAllVisible } from '../../functions';
23
+import { isMoreActionsVisible, isMuteAllVisible } from '../../functions';
24 24
 import {
25 25
     AddBreakoutRoomButton,
26 26
     AutoAssignButton,
@@ -57,7 +57,6 @@ const ParticipantsPane = () => {
57 57
     const inBreakoutRoom = useSelector(isInBreakoutRoom);
58 58
     const showAddBreakoutRoom = useSelector(isAddBreakoutRoomButtonVisible);
59 59
     const showAutoAssign = useSelector(isAutoAssignParticipantsVisible);
60
-    const showFooterMenu = useSelector(isFooterMenuVisible);
61 60
     const showMoreActions = useSelector(isMoreActionsVisible);
62 61
     const showMuteAll = useSelector(isMuteAllVisible);
63 62
     const lobbyParticipants = useSelector(getKnockingParticipants);
@@ -88,7 +87,7 @@ const ParticipantsPane = () => {
88 87
                 showAddBreakoutRoom && <AddBreakoutRoomButton />
89 88
             }
90 89
             {
91
-                showFooterMenu
90
+                isLocalModerator
92 91
                 && <View style = { styles.participantsPaneFooter }>
93 92
                     {
94 93
                         showMuteAll && (

+ 2
- 2
react/features/participants-pane/components/web/ParticipantsPane.js 查看文件

@@ -7,6 +7,7 @@ import participantsPaneTheme from '../../../base/components/themes/participantsP
7 7
 import { openDialog } from '../../../base/dialog';
8 8
 import { translate } from '../../../base/i18n';
9 9
 import { Icon, IconClose, IconHorizontalPoints } from '../../../base/icons';
10
+import { isLocalParticipantModerator } from '../../../base/participants/functions';
10 11
 import { connect } from '../../../base/redux';
11 12
 import { isAddBreakoutRoomButtonVisible } from '../../../breakout-rooms/functions';
12 13
 import { MuteEveryoneDialog } from '../../../video-menu/components/';
@@ -14,7 +15,6 @@ import { close } from '../../actions';
14 15
 import {
15 16
     findAncestorByClass,
16 17
     getParticipantsPaneOpen,
17
-    isFooterMenuVisible,
18 18
     isMoreActionsVisible,
19 19
     isMuteAllVisible
20 20
 } from '../../functions';
@@ -402,7 +402,7 @@ function _mapStateToProps(state: Object) {
402 402
         _isBreakoutRoomsSupported,
403 403
         _paneOpen: isPaneOpen,
404 404
         _showAddRoomButton: isAddBreakoutRoomButtonVisible(state),
405
-        _showFooter: isFooterMenuVisible(state),
405
+        _showFooter: isLocalParticipantModerator(state),
406 406
         _showMuteAllButton: isMuteAllVisible(state),
407 407
         _showMoreActionsButton: isMoreActionsVisible(state)
408 408
     };

+ 21
- 25
react/features/participants-pane/functions.js 查看文件

@@ -18,7 +18,7 @@ import {
18 18
 } from '../base/participants/functions';
19 19
 import { toState } from '../base/redux';
20 20
 import { normalizeAccents } from '../base/util/strings';
21
-import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
21
+import { isInBreakoutRoom } from '../breakout-rooms/functions';
22 22
 
23 23
 import { QUICK_ACTION_BUTTON, REDUCER_KEY, MEDIA_STATE } from './constants';
24 24
 
@@ -141,6 +141,20 @@ export const getComputedOuterHeight = (element: HTMLElement) => {
141 141
  */
142 142
 const getState = (state: Object) => state[REDUCER_KEY];
143 143
 
144
+/**
145
+ * Returns the participants pane config.
146
+ *
147
+ * @param {Function|Object} stateful - The redux store, the redux
148
+ * {@code getState} function, or the redux state itself.
149
+ * @returns {Object}
150
+ */
151
+export const getParticipantsPaneConfig = (stateful: Function | Object) => {
152
+    const state = toState(stateful);
153
+    const { participantsPane = {} } = state['features/base/config'];
154
+
155
+    return participantsPane;
156
+};
157
+
144 158
 /**
145 159
  * Is the participants pane open.
146 160
  *
@@ -262,22 +276,6 @@ export function participantMatchesSearch(participant: Object, searchString: stri
262 276
     return false;
263 277
 }
264 278
 
265
-/**
266
- * Returns whether the participants pane footer menu is visible.
267
- *
268
- * @param {Object} state - Global state.
269
- * @returns {boolean}
270
- */
271
-export const isFooterMenuVisible = (state: Object) => {
272
-    const isLocalModerator = isLocalParticipantModerator(state);
273
-    const inBreakoutRoom = isInBreakoutRoom(state);
274
-    const { hideFooterMenu } = getBreakoutRoomsConfig(state);
275
-
276
-    return inBreakoutRoom
277
-        ? !hideFooterMenu && isLocalModerator
278
-        : isLocalModerator;
279
-};
280
-
281 279
 /**
282 280
  * Returns whether the more actions button is visible.
283 281
  *
@@ -285,12 +283,11 @@ export const isFooterMenuVisible = (state: Object) => {
285 283
  * @returns {boolean}
286 284
  */
287 285
 export const isMoreActionsVisible = (state: Object) => {
286
+    const isLocalModerator = isLocalParticipantModerator(state);
288 287
     const inBreakoutRoom = isInBreakoutRoom(state);
289
-    const { hideMoreActionsButton } = getBreakoutRoomsConfig(state);
288
+    const { hideMoreActionsButton } = getParticipantsPaneConfig(state);
290 289
 
291
-    return inBreakoutRoom
292
-        ? !hideMoreActionsButton
293
-        : true;
290
+    return inBreakoutRoom ? false : !hideMoreActionsButton && isLocalModerator;
294 291
 };
295 292
 
296 293
 /**
@@ -300,10 +297,9 @@ export const isMoreActionsVisible = (state: Object) => {
300 297
  * @returns {boolean}
301 298
  */
302 299
 export const isMuteAllVisible = (state: Object) => {
300
+    const isLocalModerator = isLocalParticipantModerator(state);
303 301
     const inBreakoutRoom = isInBreakoutRoom(state);
304
-    const { hideMuteAllButton } = getBreakoutRoomsConfig(state);
302
+    const { hideMuteAllButton } = getParticipantsPaneConfig(state);
305 303
 
306
-    return inBreakoutRoom
307
-        ? !hideMuteAllButton
308
-        : true;
304
+    return inBreakoutRoom ? false : !hideMuteAllButton && isLocalModerator;
309 305
 };

+ 5
- 11
react/features/settings/functions.js 查看文件

@@ -11,9 +11,9 @@ import {
11 11
 import { toState } from '../base/redux';
12 12
 import { getHideSelfView } from '../base/settings';
13 13
 import { parseStandardURIString } from '../base/util';
14
-import { getBreakoutRoomsConfig, isInBreakoutRoom } from '../breakout-rooms/functions';
15 14
 import { isStageFilmstripEnabled } from '../filmstrip/functions';
16 15
 import { isFollowMeActive } from '../follow-me';
16
+import { getParticipantsPaneConfig } from '../participants-pane/functions';
17 17
 import { isReactionsEnabled } from '../reactions/functions.any';
18 18
 
19 19
 import { SS_DEFAULT_FRAME_RATE, SS_SUPPORTED_FRAMERATES } from './constants';
@@ -181,16 +181,10 @@ export function getModeratorTabProps(stateful: Object | Function) {
181 181
  */
182 182
 export function shouldShowModeratorSettings(stateful: Object | Function) {
183 183
     const state = toState(stateful);
184
-    const inBreakoutRoom = isInBreakoutRoom(state);
185
-    const { hideModeratorSettingsTab } = getBreakoutRoomsConfig(state);
186
-    const hasModeratorRights = Boolean(
187
-        isSettingEnabled('moderator')
188
-        && isLocalParticipantModerator(state)
189
-    );
190
-
191
-    return inBreakoutRoom
192
-        ? hasModeratorRights && !hideModeratorSettingsTab
193
-        : hasModeratorRights;
184
+    const { hideModeratorSettingsTab } = getParticipantsPaneConfig(state);
185
+    const hasModeratorRights = Boolean(isSettingEnabled('moderator') && isLocalParticipantModerator(state));
186
+
187
+    return hasModeratorRights && !hideModeratorSettingsTab;
194 188
 }
195 189
 
196 190
 /**

Loading…
取消
儲存