From 8940b5c9c51baf1b3c33e34dfc57a8edf76c1497 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=D0=94=D0=B0=D0=BC=D1=8F=D0=BD=20=D0=9C=D0=B8=D0=BD=D0=BA?= =?UTF-8?q?=D0=BE=D0=B2?= Date: Wed, 2 Oct 2024 17:57:14 -0500 Subject: [PATCH] fix(transcriptions): Fixes transcription status, going offline. (#2581) * fix(transcriptions): Fixes transcription status, going offline. * squash: Fixes undefined error. --- 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..480fa63883 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 && 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).