Compare commits

...

1 Commits

Author SHA1 Message Date
Jaya Allamsetty
c67b4087fa fix(av-moderation) Check for moderation before unmuting mic/camera or starting share 2025-07-17 16:42:20 -04:00
2 changed files with 41 additions and 0 deletions

View File

@@ -18,6 +18,8 @@ import {
maybeRedirectToWelcomePage,
reloadWithStoredParams
} from './react/features/app/actions';
import { showModeratedNotification } from './react/features/av-moderation/actions';
import { shouldShowModeratedNotification } from './react/features/av-moderation/functions';
import {
_conferenceWillJoin,
authStatusChanged,
@@ -151,6 +153,7 @@ import {
DATA_CHANNEL_CLOSED_NOTIFICATION_ID,
NOTIFICATION_TIMEOUT_TYPE
} from './react/features/notifications/constants';
import { isModerationNotificationDisplayed } from './react/features/notifications/functions';
import { suspendDetected } from './react/features/power-monitor/actions';
import { initPrejoin, isPrejoinPageVisible } from './react/features/prejoin/functions';
import { disableReceiver, stopReceiver } from './react/features/remote-control/actions';
@@ -701,6 +704,14 @@ export default {
return;
}
if (!mute && shouldShowModeratedNotification(MEDIA_TYPE.AUDIO, state)) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.AUDIO, state)) {
APP.store.dispatch(showModeratedNotification(MEDIA_TYPE.AUDIO));
}
return;
}
await APP.store.dispatch(setAudioMuted(mute, true));
},
@@ -743,6 +754,15 @@ export default {
return;
}
// check for A/V Moderation when trying to unmute and return early
if (!mute && shouldShowModeratedNotification(MEDIA_TYPE.VIDEO, state)) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.VIDEO, state)) {
APP.store.dispatch(showModeratedNotification(MEDIA_TYPE.VIDEO));
}
return;
}
APP.store.dispatch(setVideoMuted(mute, VIDEO_MUTISM_AUTHORITY.USER, true));
},

View File

@@ -1,8 +1,12 @@
import { IStore } from '../app/types';
import { showModeratedNotification } from '../av-moderation/actions';
import { MEDIA_TYPE } from '../av-moderation/constants';
import { shouldShowModeratedNotification } from '../av-moderation/functions';
import { openDialog } from '../base/dialog/actions';
import { browser } from '../base/lib-jitsi-meet';
import { shouldHideShareAudioHelper } from '../base/settings/functions.web';
import { toggleScreensharing } from '../base/tracks/actions.web';
import { isModerationNotificationDisplayed } from '../notifications/functions';
import {
SET_SCREENSHARE_TRACKS,
@@ -57,6 +61,15 @@ export function startAudioScreenShareFlow() {
const state = getState();
const audioOnlySharing = isAudioOnlySharing(state);
// check for A/V Moderation when trying to unmute and return early
if (shouldShowModeratedNotification(MEDIA_TYPE.DESKTOP, state)) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.DESKTOP, state)) {
dispatch(showModeratedNotification(MEDIA_TYPE.DESKTOP));
}
return;
}
// If we're already in a normal screen sharing session, warn the user.
if (isScreenVideoShared(state)) {
dispatch(openDialog(ShareMediaWarningDialog, { _isAudioScreenShareWarning: true }));
@@ -92,6 +105,14 @@ export function startScreenShareFlow(enabled: boolean) {
const state = getState();
const audioOnlySharing = isAudioOnlySharing(state);
// check for A/V Moderation when trying to unmute and return early
if (enabled && shouldShowModeratedNotification(MEDIA_TYPE.DESKTOP, state)) {
if (!isModerationNotificationDisplayed(MEDIA_TYPE.DESKTOP, state)) {
dispatch(showModeratedNotification(MEDIA_TYPE.DESKTOP));
}
return;
}
// If we're in an audio screen sharing session, warn the user.
if (audioOnlySharing) {
dispatch(openDialog(ShareMediaWarningDialog, { _isAudioScreenShareWarning: false }));