瀏覽代碼

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.
dev1
Дамян Минков 3 年之前
父節點
當前提交
9e98e98903
沒有連結到貢獻者的電子郵件帳戶。
共有 4 個檔案被更改,包括 28 行新增3 行删除
  1. 10
    1
      JitsiParticipant.js
  2. 9
    1
      modules/xmpp/ChatRoom.js
  3. 7
    1
      types/auto/JitsiParticipant.d.ts
  4. 2
    0
      types/auto/modules/xmpp/ChatRoom.d.ts

+ 10
- 1
JitsiParticipant.js 查看文件

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
      * from the meeting.
204
      * from the meeting.
196
      */
205
      */
197
     isReplacing() {
206
     isReplacing() {

+ 9
- 1
modules/xmpp/ChatRoom.js 查看文件

110
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
110
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
111
      * This is intended to be used only for lobby rooms.
111
      * This is intended to be used only for lobby rooms.
112
      * @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
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
     constructor(connection, jid, password, XMPP, options) {
116
     constructor(connection, jid, password, XMPP, options) {
115
         super();
117
         super();
488
 
490
 
489
             if (userInfo) {
491
             if (userInfo) {
490
                 identity.user = {};
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
                     const child
500
                     const child
493
                         = userInfo.children.find(c => c.tagName === tag);
501
                         = userInfo.children.find(c => c.tagName === tag);
494
 
502
 

+ 7
- 1
types/auto/JitsiParticipant.d.ts 查看文件

116
      */
116
      */
117
     isHidden(): boolean;
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
      * from the meeting.
126
      * from the meeting.
121
      */
127
      */
122
     isReplacing(): boolean;
128
     isReplacing(): boolean;

+ 2
- 0
types/auto/modules/xmpp/ChatRoom.d.ts 查看文件

27
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
27
      * @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
28
      * This is intended to be used only for lobby rooms.
28
      * This is intended to be used only for lobby rooms.
29
      * @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
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
     constructor(connection: XmppConnection, jid: any, password: any, XMPP: any, options: any);
33
     constructor(connection: XmppConnection, jid: any, password: any, XMPP: any, options: any);
32
     xmpp: any;
34
     xmpp: any;

Loading…
取消
儲存