Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.
TypeScript debiandeep-videojitsijitsi-meetscalable-video-conferencessfuvideovideo-communicationvideo-conferencingwebrtc
feat(raise-hand) group options in config.js
Mengyuan Liu8299aa498bc7
diff --git a/config.js b/config.jsindex a14f348adf..c902fec052 100644--- a/config.js+++ b/config.js@@ -232,9 +232,26 @@ var config = {// Sets the preferred resolution (height) for local video. Defaults to 720.// resolution: 720,+ // DEPRECATED. Please use raisedHands.disableRemoveRaisedHandOnFocus instead.// Specifies whether the raised hand will hide when someone becomes a dominant speaker or not// disableRemoveRaisedHandOnFocus: false,+ // Specifies which raised hand related config should be set.+ // raisedHands: {+ // // Specifies whether the raised hand can be lowered by moderator.+ // disableLowerHandByModerator: false,++ // // Specifies whether there is a notification before hiding the raised hand+ // // when someone becomes the dominant speaker.+ // disableLowerHandNotification: true,++ // // Specifies whether there is a notification when you are the next speaker in line.+ // disableNextSpeakerNotification: false,++ // // Specifies whether the raised hand will hide when someone becomes a dominant speaker or not.+ // disableRemoveRaisedHandOnFocus: false,+ // },+// speakerStats: {// // Specifies whether the speaker stats is enable or not.// disabled: false,diff --git a/react/features/base/config/configType.ts b/react/features/base/config/configType.tsindex 52386194e3..65818c8fe1 100644--- a/react/features/base/config/configType.ts+++ b/react/features/base/config/configType.ts@@ -488,6 +488,12 @@ export interface IConfig {hideExtraJoinButtons?: Array<string>;};prejoinPageEnabled?: boolean;+ raisedHands?: {+ disableLowerHandByModerator?: boolean;+ disableLowerHandNotification?: boolean;+ disableNextSpeakerNotification?: boolean;+ disableRemoveRaisedHandOnFocus?: boolean;+ };readOnlyName?: boolean;recordingLimit?: {appName?: string;diff --git a/react/features/base/config/configWhitelist.ts b/react/features/base/config/configWhitelist.tsindex 1caa2d3303..147685c7f7 100644--- a/react/features/base/config/configWhitelist.ts+++ b/react/features/base/config/configWhitelist.ts@@ -201,6 +201,7 @@ export default ['preferVisitor','prejoinConfig','prejoinPageEnabled',+ 'raisedHands','recordingService','requireDisplayName','remoteVideoMenu',diff --git a/react/features/base/config/functions.any.ts b/react/features/base/config/functions.any.tsindex 8393a2d0a0..035e7a557a 100644--- a/react/features/base/config/functions.any.ts+++ b/react/features/base/config/functions.any.ts@@ -89,7 +89,37 @@ export function getFeatureFlag(state: IReduxState, featureFlag: string) {* @returns {boolean}*/export function getDisableRemoveRaisedHandOnFocus(state: IReduxState) {- return state['features/base/config']?.disableRemoveRaisedHandOnFocus || false;+ return state['features/base/config']?.raisedHands?.disableRemoveRaisedHandOnFocus || false;+}++/**+ * Selector used to get the disableLowerHandByModerator.+ *+ * @param {Object} state - The global state.+ * @returns {boolean}+ */+export function getDisableLowerHandByModerator(state: IReduxState) {+ return state['features/base/config']?.raisedHands?.disableLowerHandByModerator || false;+}++/**+ * Selector used to get the disableLowerHandNotification.+ *+ * @param {Object} state - The global state.+ * @returns {boolean}+ */+export function getDisableLowerHandNotification(state: IReduxState) {+ return state['features/base/config']?.raisedHands?.disableLowerHandNotification || true;+}++/**+ * Selector used to get the disableNextSpeakerNotification.+ *+ * @param {Object} state - The global state.+ * @returns {boolean}+ */+export function getDisableNextSpeakerNotification(state: IReduxState) {+ return state['features/base/config']?.raisedHands?.disableNextSpeakerNotification || false;}/**diff --git a/react/features/base/config/reducer.ts b/react/features/base/config/reducer.tsindex 00812289cd..027e609b3e 100644--- a/react/features/base/config/reducer.ts+++ b/react/features/base/config/reducer.ts@@ -442,6 +442,12 @@ function _translateLegacyConfig(oldValue: IConfig) {newValue.disabledSounds.unshift('INCOMING_MSG_SOUND');}+ newValue.raisedHands = newValue.raisedHands || {};++ if (oldValue.disableRemoveRaisedHandOnFocus) {+ newValue.raisedHands.disableRemoveRaisedHandOnFocus = oldValue.disableRemoveRaisedHandOnFocus;+ }+if (oldValue.stereo || oldValue.opusMaxAverageBitrate) {newValue.audioQuality = {opusMaxAverageBitrate: oldValue.audioQuality?.opusMaxAverageBitrate ?? oldValue.opusMaxAverageBitrate,diff --git a/react/features/base/participants/subscriber.ts b/react/features/base/participants/subscriber.tsindex 89750c0f1d..26a45186d4 100644--- a/react/features/base/participants/subscriber.ts+++ b/react/features/base/participants/subscriber.ts@@ -6,7 +6,11 @@ import { IStore } from '../../app/types';import { hideNotification, showNotification } from '../../notifications/actions';import { NOTIFICATION_TIMEOUT_TYPE, RAISE_HAND_NOTIFICATION_ID } from '../../notifications/constants';import { getCurrentConference } from '../conference/functions';-import { getSsrcRewritingFeatureFlag, hasBeenNotified, isNextToSpeak } from '../config/functions.any';+import {+ getDisableNextSpeakerNotification,+ getSsrcRewritingFeatureFlag,+ hasBeenNotified,+ isNextToSpeak } from '../config/functions.any';import { VIDEO_TYPE } from '../media/constants';import StateListenerRegistry from '../redux/StateListenerRegistry';@@ -33,7 +37,10 @@ StateListenerRegistry.register(StateListenerRegistry.register(/* selector */ state => state['features/base/participants'].raisedHandsQueue,/* listener */ (raisedHandsQueue, store) => {- if (raisedHandsQueue.length && isNextToSpeak(store.getState()) && !hasBeenNotified(store.getState())) {+ if (raisedHandsQueue.length+ && isNextToSpeak(store.getState())+ && !hasBeenNotified(store.getState())+ && !getDisableNextSpeakerNotification(store.getState())) {_notifyNextSpeakerInRaisedHandQueue(store);}if (!raisedHandsQueue[0]) {diff --git a/react/features/conference/middleware.any.ts b/react/features/conference/middleware.any.tsindex a6c2eaef98..adbd900d06 100644--- a/react/features/conference/middleware.any.ts+++ b/react/features/conference/middleware.any.ts@@ -13,6 +13,7 @@ import {ENDPOINT_MESSAGE_RECEIVED} from '../base/conference/actionTypes';import { getCurrentConference } from '../base/conference/functions';+import { getDisableLowerHandByModerator } from '../base/config/functions.any';import { getURLWithoutParamsNormalized } from '../base/connection/utils';import { hideDialog } from '../base/dialog/actions';import { isDialogOpen } from '../base/dialog/functions';@@ -75,9 +76,11 @@ MiddlewareRegistry.register(store => next => action => {}case ENDPOINT_MESSAGE_RECEIVED: {const { participant, data } = action;- const { dispatch } = store;+ const { dispatch, getState } = store;- if (data.name === LOWER_HAND_MESSAGE && participant.isModerator()) {+ if (data.name === LOWER_HAND_MESSAGE+ && participant.isModerator()+ && !getDisableLowerHandByModerator(getState())) {dispatch(raiseHand(false));}break;