Skip to content

Commit

Permalink
fix(transcriptions): Fixes transcription status, going offline. (#2581)
Browse files Browse the repository at this point in the history
* fix(transcriptions): Fixes transcription status, going offline.

* squash: Fixes undefined error.
  • Loading branch information
damencho authored Oct 2, 2024
1 parent 71f572c commit 8940b5c
Showing 2 changed files with 29 additions and 3 deletions.
20 changes: 17 additions & 3 deletions modules/xmpp/ChatRoom.js
Original file line number Diff line number Diff line change
@@ -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);
12 changes: 12 additions & 0 deletions modules/xmpp/xmpp.js
Original file line number Diff line number Diff line change
@@ -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).

0 comments on commit 8940b5c

Please sign in to comment.