Browse Source

Add config options for presence & join/leave message visibility

j8
Vlad Piersec 5 years ago
parent
commit
ad68a87dba

+ 7
- 1
interface_config.js View File

193
     /**
193
     /**
194
      * If we should capture periodic screenshots of the content sharing.
194
      * If we should capture periodic screenshots of the content sharing.
195
      */
195
      */
196
-    ENABLE_SCREENSHOT_CAPTURE: false
196
+    ENABLE_SCREENSHOT_CAPTURE: false,
197
+
198
+    // If true, presence status: busy, calling, connected etc. is not displayed
199
+    DISABLE_PRESENCE_STATUS: false,
200
+
201
+    // If true, notifications regarding joining/leaving are no longer displayed
202
+    DISABLE_JOIN_LEAVE_NOTIFICATIONS: false
197
 
203
 
198
     /**
204
     /**
199
      * How many columns the tile view can expand to. The respected range is
205
      * How many columns the tile view can expand to. The respected range is

+ 2
- 0
react/features/base/config/interfaceConfigWhitelist.js View File

18
     'CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT',
18
     'CONNECTION_INDICATOR_AUTO_HIDE_TIMEOUT',
19
     'CONNECTION_INDICATOR_DISABLED',
19
     'CONNECTION_INDICATOR_DISABLED',
20
     'DEFAULT_BACKGROUND',
20
     'DEFAULT_BACKGROUND',
21
+    'DISABLE_PRESENCE_STATUS',
22
+    'DISABLE_JOIN_LEAVE_NOTIFICATIONS',
21
     'DEFAULT_LOCAL_DISPLAY_NAME',
23
     'DEFAULT_LOCAL_DISPLAY_NAME',
22
     'DEFAULT_REMOTE_DISPLAY_NAME',
24
     'DEFAULT_REMOTE_DISPLAY_NAME',
23
     'DISABLE_DOMINANT_SPEAKER_INDICATOR',
25
     'DISABLE_DOMINANT_SPEAKER_INDICATOR',

+ 11
- 0
react/features/notifications/functions.js View File

2
 
2
 
3
 import { toState } from '../base/redux';
3
 import { toState } from '../base/redux';
4
 
4
 
5
+declare var interfaceConfig: Object;
6
+
5
 /**
7
 /**
6
  * Tells whether or not the notifications are enabled and if there are any
8
  * Tells whether or not the notifications are enabled and if there are any
7
  * notifications to be displayed based on the current Redux state.
9
  * notifications to be displayed based on the current Redux state.
15
 
17
 
16
     return enabled && notifications.length > 0;
18
     return enabled && notifications.length > 0;
17
 }
19
 }
20
+
21
+/**
22
+ * Tells wether join/leave notifications are enabled in interface_config.
23
+ *
24
+ * @returns {boolean}
25
+ */
26
+export function joinLeaveNotificationsDisabled() {
27
+    return Boolean(interfaceConfig?.DISABLE_JOIN_LEAVE_NOTIFICATIONS);
28
+}

+ 16
- 14
react/features/notifications/middleware.js View File

15
     showParticipantJoinedNotification
15
     showParticipantJoinedNotification
16
 } from './actions';
16
 } from './actions';
17
 import { NOTIFICATION_TIMEOUT } from './constants';
17
 import { NOTIFICATION_TIMEOUT } from './constants';
18
+import { joinLeaveNotificationsDisabled } from './functions';
18
 
19
 
19
 declare var interfaceConfig: Object;
20
 declare var interfaceConfig: Object;
20
 
21
 
31
 
32
 
32
         const { participant: p } = action;
33
         const { participant: p } = action;
33
 
34
 
34
-        if (!p.local) {
35
+        if (!p.local && !joinLeaveNotificationsDisabled()) {
35
             store.dispatch(showParticipantJoinedNotification(
36
             store.dispatch(showParticipantJoinedNotification(
36
                 getParticipantDisplayName(store.getState, p.id)
37
                 getParticipantDisplayName(store.getState, p.id)
37
             ));
38
             ));
40
         return result;
41
         return result;
41
     }
42
     }
42
     case PARTICIPANT_LEFT: {
43
     case PARTICIPANT_LEFT: {
43
-        const participant = getParticipantById(
44
-            store.getState(),
45
-            action.participant.id
46
-        );
44
+        if (!joinLeaveNotificationsDisabled()) {
45
+            const participant = getParticipantById(
46
+                store.getState(),
47
+                action.participant.id
48
+            );
47
 
49
 
48
-        if (typeof interfaceConfig === 'object'
49
-            && participant
50
-            && !participant.local) {
51
-            store.dispatch(showNotification({
52
-                descriptionKey: 'notify.disconnected',
53
-                titleKey: 'notify.somebody',
54
-                title: participant.name
55
-            },
56
-            NOTIFICATION_TIMEOUT));
50
+            if (typeof interfaceConfig === 'object'
51
+                && participant
52
+                && !participant.local) {
53
+                store.dispatch(showNotification({
54
+                    descriptionKey: 'notify.disconnected',
55
+                    titleKey: 'notify.somebody',
56
+                    title: participant.name
57
+                }, NOTIFICATION_TIMEOUT));
58
+            }
57
         }
59
         }
58
 
60
 
59
         return next(action);
61
         return next(action);

+ 4
- 2
react/features/presence-status/components/PresenceLabel.js View File

8
 import { connect } from '../../base/redux';
8
 import { connect } from '../../base/redux';
9
 
9
 
10
 import { STATUS_TO_I18N_KEY } from '../constants';
10
 import { STATUS_TO_I18N_KEY } from '../constants';
11
+import { presenceStatusDisabled } from '../functions';
11
 
12
 
12
 /**
13
 /**
13
  * The type of the React {@code Component} props of {@link PresenceLabel}.
14
  * The type of the React {@code Component} props of {@link PresenceLabel}.
124
     const participant = getParticipantById(state, ownProps.participantID);
125
     const participant = getParticipantById(state, ownProps.participantID);
125
 
126
 
126
     return {
127
     return {
127
-        _presence:
128
-            (participant && participant.presence) || ownProps.defaultPresence
128
+        _presence: presenceStatusDisabled() ? ''
129
+            : participant?.presence || ownProps.defaultPresence
130
+
129
     };
131
     };
130
 }
132
 }
131
 
133
 

+ 12
- 0
react/features/presence-status/functions.js View File

1
+// @flow
2
+
3
+declare var interfaceConfig: Object;
4
+
5
+/**
6
+ * Tells wether presence status should be displayed.
7
+ *
8
+ * @returns {boolean}
9
+ */
10
+export function presenceStatusDisabled() {
11
+    return Boolean(interfaceConfig?.DISABLE_PRESENCE_STATUS);
12
+}

Loading…
Cancel
Save