Skip to content

Commit

Permalink
feat: Adds a property to JitsiParticipant is hidden from recorder. (#…
Browse files Browse the repository at this point in the history
…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.
  • Loading branch information
damencho authored Feb 17, 2022
1 parent 9eb93e0 commit 9e98e98
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 3 deletions.
11 changes: 10 additions & 1 deletion JitsiParticipant.js
Original file line number Diff line number Diff line change
Expand Up @@ -191,7 +191,16 @@ export default class JitsiParticipant {
}

/**
* @returns {Boolean} Wheter this participants replaces another participant
* @returns {Boolean} Whether this participant is a hidden participant. Some
* special system participants may want to join hidden (like for example the
* recorder).
*/
isHiddenFromRecorder() {
return Boolean(this._identity?.user?.['hidden-from-recorder']);
}

/**
* @returns {Boolean} Whether this participant replaces another participant
* from the meeting.
*/
isReplacing() {
Expand Down
10 changes: 9 additions & 1 deletion modules/xmpp/ChatRoom.js
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,8 @@ export default class ChatRoom extends Listenable {
* @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
* This is intended to be used only for lobby rooms.
* @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
* @param {boolean} options.hiddenFromRecorderFeatureEnabled - when set to {@code true} we will check identity tag
* for node presence.
*/
constructor(connection, jid, password, XMPP, options) {
super();
Expand Down Expand Up @@ -488,7 +490,13 @@ export default class ChatRoom extends Listenable {

if (userInfo) {
identity.user = {};
for (const tag of [ 'id', 'name', 'avatar' ]) {
const tags = [ 'id', 'name', 'avatar' ];

if (this.options.hiddenFromRecorderFeatureEnabled) {
tags.push('hidden-from-recorder');
}

for (const tag of tags) {
const child
= userInfo.children.find(c => c.tagName === tag);

Expand Down
8 changes: 7 additions & 1 deletion types/auto/JitsiParticipant.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,13 @@ export default class JitsiParticipant {
*/
isHidden(): boolean;
/**
* @returns {Boolean} Wheter this participants replaces another participant
* @returns {Boolean} Whether this participant is a hidden participant. Some
* special system participants may want to join hidden (like for example the
* recorder).
*/
isHiddenFromRecorder(): boolean;
/**
* @returns {Boolean} Whether this participant replaces another participant
* from the meeting.
*/
isReplacing(): boolean;
Expand Down
2 changes: 2 additions & 0 deletions types/auto/modules/xmpp/ChatRoom.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,8 @@ export default class ChatRoom extends Listenable {
* @param {boolean} options.disableDiscoInfo - when set to {@code false} will skip disco info.
* This is intended to be used only for lobby rooms.
* @param {boolean} options.enableLobby - when set to {@code false} will skip creating lobby room.
* @param {boolean} options.hiddenFromRecorderFeatureEnabled - when set to {@code true} we will check identity tag
* for node presence.
*/
constructor(connection: XmppConnection, jid: any, password: any, XMPP: any, options: any);
xmpp: any;
Expand Down

0 comments on commit 9e98e98

Please sign in to comment.