Skip to content

Commit

Permalink
fix(visitors): Fixes detection of turning of subtitles by visitor.
Browse files Browse the repository at this point in the history
  • Loading branch information
damencho committed Nov 7, 2024
1 parent e52c6e6 commit da35c96
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions resources/prosody-plugins/mod_fmuc.lua
Original file line number Diff line number Diff line change
Expand Up @@ -353,15 +353,15 @@ module:hook('muc-broadcast-presence', function (event)
module:send(promotion_request);
end

local requestTranscriptionValue = full_p:get_child_text(PARTICIPANT_PROP_REQUEST_TRANSCRIPTION);
local hasTranscriptionEnabled = room._transcription_languages and room._transcription_languages[occupant.jid];

-- detect transcription
if full_p:get_child_text(PARTICIPANT_PROP_REQUEST_TRANSCRIPTION) then
if requestTranscriptionValue == 'true' then
local lang = full_p:get_child_text(PARTICIPANT_PROP_TRANSLATION_LANG);

occupant._transcription_enabled = true;

add_transcription(room, occupant, lang);
elseif occupant._transcription_enabled then
occupant._transcription_enabled = false;
elseif hasTranscriptionEnabled then
remove_transcription(room, occupant, nil);
end

Expand Down

0 comments on commit da35c96

Please sign in to comment.