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
Add config options for presence & join/leave message visibility
Vlad Piersecad68a87dba4d
diff --git a/interface_config.js b/interface_config.jsindex e8eadb4bee..93f8196319 100644--- a/interface_config.js+++ b/interface_config.js@@ -193,7 +193,13 @@ var interfaceConfig = {/*** If we should capture periodic screenshots of the content sharing.*/- ENABLE_SCREENSHOT_CAPTURE: false+ ENABLE_SCREENSHOT_CAPTURE: false,++ // If true, presence status: busy, calling, connected etc. is not displayed+ DISABLE_PRESENCE_STATUS: false,++ // If true, notifications regarding joining/leaving are no longer displayed+ DISABLE_JOIN_LEAVE_NOTIFICATIONS: false/*** How many columns the tile view can expand to. The respected range isdiff --git a/react/features/base/config/interfaceConfigWhitelist.js b/react/features/base/config/interfaceConfigWhitelist.jsindex f37762a2cc..26feb38ecb 100644--- a/react/features/base/config/interfaceConfigWhitelist.js+++ b/react/features/base/config/interfaceConfigWhitelist.js@@ -18,6 +18,8 @@ export default ['CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT','CONNECTION_INDICATOR_DISABLED','DEFAULT_BACKGROUND',+ 'DISABLE_PRESENCE_STATUS',+ 'DISABLE_JOIN_LEAVE_NOTIFICATIONS','DEFAULT_LOCAL_DISPLAY_NAME','DEFAULT_REMOTE_DISPLAY_NAME','DISABLE_DOMINANT_SPEAKER_INDICATOR',diff --git a/react/features/notifications/functions.js b/react/features/notifications/functions.jsindex 2d1de4fdc6..f2664d7ccf 100644--- a/react/features/notifications/functions.js+++ b/react/features/notifications/functions.js@@ -2,6 +2,8 @@import { toState } from '../base/redux';+declare var interfaceConfig: Object;+/*** Tells whether or not the notifications are enabled and if there are any* notifications to be displayed based on the current Redux state.@@ -15,3 +17,12 @@ export function areThereNotifications(stateful: Object | Function) {return enabled && notifications.length > 0;}++/**+ * Tells wether join/leave notifications are enabled in interface_config.+ *+ * @returns {boolean}+ */+export function joinLeaveNotificationsDisabled() {+ return Boolean(interfaceConfig?.DISABLE_JOIN_LEAVE_NOTIFICATIONS);+}diff --git a/react/features/notifications/middleware.js b/react/features/notifications/middleware.jsindex 394120e368..9d751dcfe8 100644--- a/react/features/notifications/middleware.js+++ b/react/features/notifications/middleware.js@@ -15,6 +15,7 @@ import {showParticipantJoinedNotification} from './actions';import { NOTIFICATION_TIMEOUT } from './constants';+import { joinLeaveNotificationsDisabled } from './functions';declare var interfaceConfig: Object;@@ -31,7 +32,7 @@ MiddlewareRegistry.register(store => next => action => {const { participant: p } = action;- if (!p.local) {+ if (!p.local && !joinLeaveNotificationsDisabled()) {store.dispatch(showParticipantJoinedNotification(getParticipantDisplayName(store.getState, p.id)));@@ -40,20 +41,21 @@ MiddlewareRegistry.register(store => next => action => {return result;}case PARTICIPANT_LEFT: {- const participant = getParticipantById(- store.getState(),- action.participant.id- );+ if (!joinLeaveNotificationsDisabled()) {+ const participant = getParticipantById(+ store.getState(),+ action.participant.id+ );- if (typeof interfaceConfig === 'object'- && participant- && !participant.local) {- store.dispatch(showNotification({- descriptionKey: 'notify.disconnected',- titleKey: 'notify.somebody',- title: participant.name- },- NOTIFICATION_TIMEOUT));+ if (typeof interfaceConfig === 'object'+ && participant+ && !participant.local) {+ store.dispatch(showNotification({+ descriptionKey: 'notify.disconnected',+ titleKey: 'notify.somebody',+ title: participant.name+ }, NOTIFICATION_TIMEOUT));+ }}return next(action);diff --git a/react/features/presence-status/components/PresenceLabel.js b/react/features/presence-status/components/PresenceLabel.jsindex 570d0b0e60..419d5a2c5b 100644--- a/react/features/presence-status/components/PresenceLabel.js+++ b/react/features/presence-status/components/PresenceLabel.js@@ -8,6 +8,7 @@ import { Text } from '../../base/react';import { connect } from '../../base/redux';import { STATUS_TO_I18N_KEY } from '../constants';+import { presenceStatusDisabled } from '../functions';/*** The type of the React {@code Component} props of {@link PresenceLabel}.@@ -124,8 +125,9 @@ function _mapStateToProps(state, ownProps) {const participant = getParticipantById(state, ownProps.participantID);return {- _presence:- (participant && participant.presence) || ownProps.defaultPresence+ _presence: presenceStatusDisabled() ? ''+ : participant?.presence || ownProps.defaultPresence+};}diff --git a/react/features/presence-status/functions.js b/react/features/presence-status/functions.jsnew file mode 100644index 0000000000..c22e4cc626--- /dev/null+++ b/react/features/presence-status/functions.js@@ -0,0 +1,12 @@+// @flow++declare var interfaceConfig: Object;++/**+ * Tells wether presence status should be displayed.+ *+ * @returns {boolean}+ */+export function presenceStatusDisabled() {+ return Boolean(interfaceConfig?.DISABLE_PRESENCE_STATUS);+}