Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

fix: Only parse transcript for transcription-result messages. (#16885)

bgrozev21ea67b29c40
diff --git a/resources/prosody-plugins/mod_muc_meeting_id.lua b/resources/prosody-plugins/mod_muc_meeting_id.lua
index 6e0e3e4938..514583ed99 100644
--- a/resources/prosody-plugins/mod_muc_meeting_id.lua
+++ b/resources/prosody-plugins/mod_muc_meeting_id.lua
@@ -212,39 +212,39 @@ local function filterTranscriptionResult(event)
-- Do not fire the event, but forward the message
return
end
- end
-
- if msg_obj.transcript ~= nil then
- local transcription = msg_obj;
- -- in case of the string matching optimization above failed
- if transcription.is_interim then
- return;
+ if msg_obj.transcript ~= nil then
+ local transcription = msg_obj;
+
+ -- in case of the string matching optimization above failed
+ if transcription.is_interim then
+ return;
+ end
+
+ -- TODO what if we have multiple alternative transcriptions not just 1
+ local text_message = transcription.transcript[1].text;
+ --do not send empty messages
+ if text_message == '' then
+ return;
+ end
+
+ local user_id = transcription.participant.id;
+ local who = room:get_occupant_by_nick(jid.bare(room.jid)..'/'..user_id);
+
+ transcription.jid = who and who.jid;
+ transcription.session_id = room._data.meetingId;
+
+ local tenant, conference_name, id = extract_subdomain(jid.node(room.jid));
+ if tenant then
+ transcription.fqn = tenant..'/'..conference_name;
+ else
+ transcription.fqn = conference_name;
+ end
+ transcription.customer_id = id;
+
+ return module:fire_event('jitsi-transcript-received', {
+ room = room, occupant = occupant, transcription = transcription, stanza = stanza });
end
-
- -- TODO what if we have multiple alternative transcriptions not just 1
- local text_message = transcription.transcript[1].text;
- --do not send empty messages
- if text_message == '' then
- return;
- end
-
- local user_id = transcription.participant.id;
- local who = room:get_occupant_by_nick(jid.bare(room.jid)..'/'..user_id);
-
- transcription.jid = who and who.jid;
- transcription.session_id = room._data.meetingId;
-
- local tenant, conference_name, id = extract_subdomain(jid.node(room.jid));
- if tenant then
- transcription.fqn = tenant..'/'..conference_name;
- else
- transcription.fqn = conference_name;
- end
- transcription.customer_id = id;
-
- return module:fire_event('jitsi-transcript-received', {
- room = room, occupant = occupant, transcription = transcription, stanza = stanza });
end
return module:fire_event('jitsi-endpoint-message-received', {