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(notifications) add ability to disable specific notifications

Saúl Ibarra Corretgé05127467c2b3
diff --git a/config.js b/config.js
index 4de947c0cf..19c89b653b 100644
--- a/config.js
+++ b/config.js
@@ -1344,6 +1344,9 @@ var config = {
// 'transcribing.failedToStart' // shown when transcribing fails to start
// ],
+ // List of notifications to be disabled. Works in tandem with the above setting.
+ // disabledNotifications: [],
+
// Prevent the filmstrip from autohiding when screen width is under a certain threshold
// disableFilmstripAutohiding: false,
diff --git a/react/features/base/config/configWhitelist.js b/react/features/base/config/configWhitelist.js
index 78c55ab268..ada80f796e 100644
--- a/react/features/base/config/configWhitelist.js
+++ b/react/features/base/config/configWhitelist.js
@@ -94,6 +94,7 @@ export default [
'disableBeforeUnloadHandlers',
'disableChatSmileys',
'disableDeepLinking',
+ 'disabledNotifications',
'disabledSounds',
'disableFilmstripAutohiding',
'disableInitialGUM',
diff --git a/react/features/notifications/actions.js b/react/features/notifications/actions.js
index 0d0ec8d26e..0d79cd88c0 100644
--- a/react/features/notifications/actions.js
+++ b/react/features/notifications/actions.js
@@ -109,10 +109,12 @@ export function showErrorNotification(props: Object, type: ?string) {
*/
export function showNotification(props: Object = {}, type: ?string) {
return function(dispatch: Function, getState: Function) {
- const { notifications, notificationTimeouts } = getState()['features/base/config'];
+ const { disabledNotifications = [], notifications, notificationTimeouts } = getState()['features/base/config'];
const enabledFlag = getFeatureFlag(getState(), NOTIFICATIONS_ENABLED, true);
const shouldDisplay = enabledFlag
+ && !(disabledNotifications.includes(props.descriptionKey)
+ || disabledNotifications.includes(props.titleKey))
&& (!notifications
|| notifications.includes(props.descriptionKey)
|| notifications.includes(props.titleKey));