Skip to content

Commit 8940b5c

Browse files
authored
fix(transcriptions): Fixes transcription status, going offline. (#2581)
* fix(transcriptions): Fixes transcription status, going offline. * squash: Fixes undefined error.
1 parent 71f572c commit 8940b5c

File tree

2 files changed

+29
-3
lines changed

2 files changed

+29
-3
lines changed

modules/xmpp/ChatRoom.js

+17-3
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ import BreakoutRooms from './BreakoutRooms';
2121
import Lobby from './Lobby';
2222
import RoomMetadata from './RoomMetadata';
2323
import XmppConnection from './XmppConnection';
24+
import { FEATURE_TRANSCRIBER } from './xmpp';
2425

2526
const logger = getLogger(__filename);
2627

@@ -833,15 +834,16 @@ export default class ChatRoom extends Listenable {
833834

834835
const { status } = attributes;
835836

836-
if (status && status !== this.transcriptionStatus) {
837+
if (status && status !== this.transcriptionStatus
838+
&& member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER)) {
837839
this.transcriptionStatus = status;
838840
this.eventEmitter.emit(
839841
XMPPEvents.TRANSCRIPTION_STATUS_CHANGED,
840-
status
842+
status,
843+
Strophe.getResourceFromJid(from)
841844
);
842845
}
843846

844-
845847
break;
846848
}
847849
case 'call-control': {
@@ -1138,6 +1140,18 @@ export default class ChatRoom extends Listenable {
11381140

11391141
// In this case we *do* fire MUC_MEMBER_LEFT for the focus?
11401142
this.eventEmitter.emit(XMPPEvents.MUC_MEMBER_LEFT, from, reason);
1143+
1144+
if (member && member.isHiddenDomain && member.features.has(FEATURE_TRANSCRIBER)
1145+
&& this.transcriptionStatus !== JitsiTranscriptionStatus.OFF) {
1146+
this.transcriptionStatus = JitsiTranscriptionStatus.OFF;
1147+
this.eventEmitter.emit(
1148+
XMPPEvents.TRANSCRIPTION_STATUS_CHANGED,
1149+
this.transcriptionStatus,
1150+
Strophe.getResourceFromJid(from),
1151+
true /* exited abruptly */
1152+
);
1153+
}
1154+
11411155
if (member?.isFocus) {
11421156
logger.info('Focus has left the room - leaving conference');
11431157
this.eventEmitter.emit(XMPPEvents.FOCUS_LEFT);

modules/xmpp/xmpp.js

+12
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,18 @@ export const JITSI_MEET_MUC_TYPE = 'type';
103103
*/
104104
export const FEATURE_JIGASI = 'http://jitsi.org/protocol/jigasi';
105105

106+
/**
107+
* The feature used by jibri participants.
108+
* @type {string}
109+
*/
110+
export const FEATURE_JIBRI = 'http://jitsi.org/protocol/jibri';
111+
112+
/**
113+
* The feature used by jigasi transcriber participants.
114+
* @type {string}
115+
*/
116+
export const FEATURE_TRANSCRIBER = 'http://jitsi.org/protocol/transcriber';
117+
106118
/**
107119
* The feature used by the lib to mark support for e2ee. We use the feature by putting it in the presence
108120
* to avoid additional signaling (disco-info).

0 commit comments

Comments
 (0)