Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

feat(av-moderation): Disable start muted settings when av moderation is on.

damenchoca7ece97bd07
diff --git a/react/features/settings/components/native/ModeratorSection.tsx b/react/features/settings/components/native/ModeratorSection.tsx
index f61593b375..5ca972403a 100644
--- a/react/features/settings/components/native/ModeratorSection.tsx
+++ b/react/features/settings/components/native/ModeratorSection.tsx
@@ -18,6 +18,7 @@ import FormSection from './FormSection';
const ModeratorSection = () => {
const dispatch = useDispatch();
const {
+ audioModerationEnabled,
chatWithPermissionsEnabled,
followMeActive,
followMeEnabled,
@@ -25,7 +26,8 @@ const ModeratorSection = () => {
followMeRecorderEnabled,
startAudioMuted,
startVideoMuted,
- startReactionsMuted
+ startReactionsMuted,
+ videoModerationEnabled
} = useSelector((state: IReduxState) => getModeratorTabProps(state));
const { disableReactionsModeration } = useSelector((state: IReduxState) => state['features/base/config']);
@@ -68,13 +70,13 @@ const ModeratorSection = () => {
const moderationSettings = useMemo(() => {
const moderation = [
{
- disabled: false,
+ disabled: audioModerationEnabled,
label: 'settings.startAudioMuted',
state: startAudioMuted,
onChange: onStartAudioMutedToggled
},
{
- disabled: false,
+ disabled: videoModerationEnabled,
label: 'settings.startVideoMuted',
state: startVideoMuted,
onChange: onStartVideoMutedToggled
diff --git a/react/features/settings/components/web/ModeratorTab.tsx b/react/features/settings/components/web/ModeratorTab.tsx
index 26ea612306..fd04f811a1 100644
--- a/react/features/settings/components/web/ModeratorTab.tsx
+++ b/react/features/settings/components/web/ModeratorTab.tsx
@@ -13,6 +13,10 @@ import Checkbox from '../../../base/ui/components/web/Checkbox';
* The type of the React {@code Component} props of {@link ModeratorTab}.
*/
export interface IProps extends AbstractDialogTabProps, WithTranslation {
+ /**
+ * Whether the user has selected the audio moderation feature to be enabled.
+ */
+ audioModerationEnabled: boolean;
/**
* Whether the user has selected the chat with permissions feature to be enabled.
@@ -71,6 +75,11 @@ export interface IProps extends AbstractDialogTabProps, WithTranslation {
* enabled.
*/
startVideoMuted: boolean;
+
+ /**
+ * Whether the user has selected the video moderation feature to be enabled.
+ */
+ videoModerationEnabled: boolean;
}
const styles = (theme: Theme) => {
@@ -200,6 +209,7 @@ class ModeratorTab extends AbstractDialogTab<IProps, any> {
*/
override render() {
const {
+ audioModerationEnabled,
chatWithPermissionsEnabled,
disableChatWithPermissions,
disableReactionsModeration,
@@ -210,7 +220,8 @@ class ModeratorTab extends AbstractDialogTab<IProps, any> {
startAudioMuted,
startVideoMuted,
startReactionsMuted,
- t
+ t,
+ videoModerationEnabled
} = this.props;
const classes = withStyles.getClasses(this.props);
@@ -223,18 +234,18 @@ class ModeratorTab extends AbstractDialogTab<IProps, any> {
<h2 className = { classes.title }>
{t('settings.moderatorOptions')}
</h2>
- <Checkbox
+ { !audioModerationEnabled && <Checkbox
checked = { startAudioMuted }
className = { classes.checkbox }
label = { t('settings.startAudioMuted') }
name = 'start-audio-muted'
- onChange = { this._onStartAudioMutedChanged } />
- <Checkbox
+ onChange = { this._onStartAudioMutedChanged } /> }
+ { !videoModerationEnabled && <Checkbox
checked = { startVideoMuted }
className = { classes.checkbox }
label = { t('settings.startVideoMuted') }
name = 'start-video-muted'
- onChange = { this._onStartVideoMutedChanged } />
+ onChange = { this._onStartVideoMutedChanged } /> }
<Checkbox
checked = { followMeEnabled && !followMeActive && !followMeRecorderChecked }
className = { classes.checkbox }
diff --git a/react/features/settings/functions.any.ts b/react/features/settings/functions.any.ts
index 5d7abd141b..d0e9a18b15 100644
--- a/react/features/settings/functions.any.ts
+++ b/react/features/settings/functions.any.ts
@@ -1,9 +1,11 @@
import { IReduxState } from '../app/types';
+import { isEnabledFromState } from '../av-moderation/functions';
import { IStateful } from '../base/app/types';
import { isNameReadOnly } from '../base/config/functions.any';
import { SERVER_URL_CHANGE_ENABLED } from '../base/flags/constants';
import { getFeatureFlag } from '../base/flags/functions';
import i18next, { DEFAULT_LANGUAGE, LANGUAGES } from '../base/i18n/i18next';
+import { MEDIA_TYPE } from '../base/media/constants';
import { getLocalParticipant } from '../base/participants/functions';
import { toState } from '../base/redux/functions';
import { getHideSelfView } from '../base/settings/functions.any';
@@ -144,9 +146,13 @@ export function getModeratorTabProps(stateful: IStateful) {
const followMeRecorderActive = isFollowMeRecorderActive(state);
const showModeratorSettings = shouldShowModeratorSettings(state);
const disableChatWithPermissions = !conference?.getMetadataHandler().getMetadata().allownersEnabled;
+ const isAudioModerationEnabled = isEnabledFromState(MEDIA_TYPE.AUDIO, state);
+ const isVideoModerationEnabled = isEnabledFromState(MEDIA_TYPE.VIDEO, state);
// The settings sections to display.
return {
+ audioModerationEnabled: isAudioModerationEnabled,
+ videoModerationEnabled: isVideoModerationEnabled,
chatWithPermissionsEnabled: Boolean(groupChatWithPermissions),
showModeratorSettings: Boolean(conference && showModeratorSettings),
disableChatWithPermissions: Boolean(disableChatWithPermissions),