Browse Source

feat: Adds a property to JitsiParticipant is hidden from recorder. (#1889)

* feat: Adds a property to JitsiParticipant is hidden from recorder.

When hiddenFromRecorder is enable in config we check the presence for the flag (the jwt identity part).

* squash: Fixes comments.
tags/v0.0.2
Дамян Минков 3 years ago
parent
commit
9e98e98903
No account linked to committer's email address

+ 10
- 1
JitsiParticipant.js View File

@@ -191,7 +191,16 @@ export default class JitsiParticipant {
191 191
     }
192 192
 
193 193
     /**
194
-     * @returns {Boolean} Wheter this participants replaces another participant
194
+     * @returns {Boolean} Whether this participant is a hidden participant. Some
195
+     * special system participants may want to join hidden (like for example the
196
+     * recorder).
197
+     */
198
+    isHiddenFromRecorder() {
199
+        return Boolean(this._identity?.user?.['hidden-from-recorder']);
200
+    }
201
+
202
+    /**
203
+     * @returns {Boolean} Whether this participant replaces another participant
195 204
      * from the meeting.
196 205
      */
197 206
     isReplacing() {

+ 9
- 1
modules/xmpp/ChatRoom.js View File

@@ -110,6 +110,8 @@ export default class ChatRoom extends Listenable {
110 110
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
111 111
      * This is intended to be used only for lobby rooms.
112 112
      * @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
113
+     * @param {boolean} options.hiddenFromRecorderFeatureEnabled - when set to {@code true} we will check identity tag
114
+     * for node presence.
113 115
      */
114 116
     constructor(connection, jid, password, XMPP, options) {
115 117
         super();
@@ -488,7 +490,13 @@ export default class ChatRoom extends Listenable {
488 490
 
489 491
             if (userInfo) {
490 492
                 identity.user = {};
491
-                for (const tag of [ 'id', 'name', 'avatar' ]) {
493
+                const tags = [ 'id', 'name', 'avatar' ];
494
+
495
+                if (this.options.hiddenFromRecorderFeatureEnabled) {
496
+                    tags.push('hidden-from-recorder');
497
+                }
498
+
499
+                for (const tag of tags) {
492 500
                     const child
493 501
                         = userInfo.children.find(c => c.tagName === tag);
494 502
 

+ 7
- 1
types/auto/JitsiParticipant.d.ts View File

@@ -116,7 +116,13 @@ export default class JitsiParticipant {
116 116
      */
117 117
     isHidden(): boolean;
118 118
     /**
119
-     * @returns {Boolean} Wheter this participants replaces another participant
119
+     * @returns {Boolean} Whether this participant is a hidden participant. Some
120
+     * special system participants may want to join hidden (like for example the
121
+     * recorder).
122
+     */
123
+    isHiddenFromRecorder(): boolean;
124
+    /**
125
+     * @returns {Boolean} Whether this participant replaces another participant
120 126
      * from the meeting.
121 127
      */
122 128
     isReplacing(): boolean;

+ 2
- 0
types/auto/modules/xmpp/ChatRoom.d.ts View File

@@ -27,6 +27,8 @@ export default class ChatRoom extends Listenable {
27 27
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
28 28
      * This is intended to be used only for lobby rooms.
29 29
      * @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
30
+     * @param {boolean} options.hiddenFromRecorderFeatureEnabled - when set to {@code true} we will check identity tag
31
+     * for node presence.
30 32
      */
31 33
     constructor(connection: XmppConnection, jid: any, password: any, XMPP: any, options: any);
32 34
     xmpp: any;

Loading…
Cancel
Save