From edbd6417502b46d9eaa015d343ce7f967d376f9a Mon Sep 17 00:00:00 2001 From: damencho Date: Tue, 1 Oct 2024 17:20:20 -0500 Subject: [PATCH 1/2] fix(transcriptions): Fixes transcription status, going offline. --- modules/xmpp/ChatRoom.js | 20 +++++++++++++++++--- modules/xmpp/xmpp.js | 12 ++++++++++++ 2 files changed, 29 insertions(+), 3 deletions(-) diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js index 7142495f87..99b7014a93 100644 --- a/modules/xmpp/ChatRoom.js +++ b/modules/xmpp/ChatRoom.js @@ -21,6 +21,7 @@ import BreakoutRooms from './BreakoutRooms'; import Lobby from './Lobby'; import RoomMetadata from './RoomMetadata'; import XmppConnection from './XmppConnection'; +import { FEATURE_TRANSCRIBER } from './xmpp'; const logger = getLogger(__filename); @@ -833,15 +834,16 @@ export default class ChatRoom extends Listenable { const { status } = attributes; - if (status && status !== this.transcriptionStatus) { + if (status && status !== this.transcriptionStatus + && member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER)) { this.transcriptionStatus = status; this.eventEmitter.emit( XMPPEvents.TRANSCRIPTION_STATUS_CHANGED, - status + status, + Strophe.getResourceFromJid(from) ); } - break; } case 'call-control': { @@ -1138,6 +1140,18 @@ export default class ChatRoom extends Listenable { // In this case we *do* fire MUC_MEMBER_LEFT for the focus? this.eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, from, reason); + + if (member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER) + && this.transcriptionStatus !== JitsiTranscriptionStatus.OFF) { + this.transcriptionStatus = JitsiTranscriptionStatus.OFF; + this.eventEmitter.emit( + XMPPEvents.TRANSCRIPTION_STATUS_CHANGED, + this.transcriptionStatus, + Strophe.getResourceFromJid(from), + true /* exited abruptly */ + ); + } + if (member?.isFocus) { logger.info('Focus has left the room - leaving conference'); this.eventEmitter.emit(XMPPEvents.FOCUS_LEFT); diff --git a/modules/xmpp/xmpp.js b/modules/xmpp/xmpp.js index a84febca6a..ce2ef71310 100644 --- a/modules/xmpp/xmpp.js +++ b/modules/xmpp/xmpp.js @@ -103,6 +103,18 @@ export const JITSI_MEET_MUC_TYPE = 'type'; */ export const FEATURE_JIGASI = 'http://jitsi.org/protocol/jigasi'; +/** + * The feature used by jibri participants. + * @type {string} + */ +export const FEATURE_JIBRI = 'http://jitsi.org/protocol/jibri'; + +/** + * The feature used by jigasi transcriber participants. + * @type {string} + */ +export const FEATURE_TRANSCRIBER = 'http://jitsi.org/protocol/transcriber'; + /** * The feature used by the lib to mark support for e2ee. We use the feature by putting it in the presence * to avoid additional signaling (disco-info). From d418c912a49e7c4ed94cab1ce267d8029fc2c2ea Mon Sep 17 00:00:00 2001 From: damencho Date: Wed, 2 Oct 2024 17:19:11 -0500 Subject: [PATCH 2/2] squash: Fixes undefined error. --- modules/xmpp/ChatRoom.js | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/xmpp/ChatRoom.js b/modules/xmpp/ChatRoom.js index 99b7014a93..480fa63883 100644 --- a/modules/xmpp/ChatRoom.js +++ b/modules/xmpp/ChatRoom.js @@ -1141,7 +1141,7 @@ export default class ChatRoom extends Listenable { // In this case we *do* fire MUC_MEMBER_LEFT for the focus? this.eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, from, reason); - if (member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER) + if (member && member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER) && this.transcriptionStatus !== JitsiTranscriptionStatus.OFF) { this.transcriptionStatus = JitsiTranscriptionStatus.OFF; this.eventEmitter.emit(