Skip to content

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

fix(moderation) Show Screensharing blocked notification (#13433)

Robert Pintiliid0f92316039b
diff --git a/react/features/av-moderation/middleware.ts b/react/features/av-moderation/middleware.ts
index 29c6e34a1e..b326bac4f2 100644
--- a/react/features/av-moderation/middleware.ts
+++ b/react/features/av-moderation/middleware.ts
@@ -48,6 +48,7 @@ import {
ASKED_TO_UNMUTE_NOTIFICATION_ID,
ASKED_TO_UNMUTE_SOUND_ID,
AUDIO_MODERATION_NOTIFICATION_ID,
+ CS_MODERATION_NOTIFICATION_ID,
VIDEO_MODERATION_NOTIFICATION_ID
} from './constants';
import {
@@ -88,6 +89,11 @@ MiddlewareRegistry.register(({ dispatch, getState }) => next => action => {
uid = VIDEO_MODERATION_NOTIFICATION_ID;
break;
}
+ case MEDIA_TYPE.SCREENSHARE: {
+ titleKey = 'notify.moderationInEffectCSTitle';
+ uid = CS_MODERATION_NOTIFICATION_ID;
+ break;
+ }
}
dispatch(showNotification({
diff --git a/react/features/base/tracks/actions.web.ts b/react/features/base/tracks/actions.web.ts
index d08a05a129..ffe6915d1b 100644
--- a/react/features/base/tracks/actions.web.ts
+++ b/react/features/base/tracks/actions.web.ts
@@ -1,6 +1,7 @@
// @ts-expect-error
import { AUDIO_ONLY_SCREEN_SHARE_NO_TRACK } from '../../../../modules/UI/UIErrors';
import { IReduxState, IStore } from '../../app/types';
+import { showModeratedNotification } from '../../av-moderation/actions';
import { shouldShowModeratedNotification } from '../../av-moderation/functions';
import { setNoiseSuppressionEnabled } from '../../noise-suppression/actions';
import { showNotification } from '../../notifications/actions';
@@ -44,6 +45,7 @@ export function toggleScreensharing(
return (dispatch: IStore['dispatch'], getState: IStore['getState']) => {
// check for A/V Moderation when trying to start screen sharing
if ((enabled || enabled === undefined) && shouldShowModeratedNotification(MEDIA_TYPE.VIDEO, getState())) {
+ dispatch(showModeratedNotification(MEDIA_TYPE.SCREENSHARE));
return Promise.reject();
}