浏览代码

fix(visitors): Fixes detection of turning of subtitles by visitor.

factor2
damencho 11 个月前
父节点
当前提交
da35c96afd
共有 1 个文件被更改,包括 5 次插入5 次删除
  1. 5
    5
      resources/prosody-plugins/mod_fmuc.lua

+ 5
- 5
resources/prosody-plugins/mod_fmuc.lua 查看文件

353
         module:send(promotion_request);
353
         module:send(promotion_request);
354
     end
354
     end
355
 
355
 
356
+    local requestTranscriptionValue = full_p:get_child_text(PARTICIPANT_PROP_REQUEST_TRANSCRIPTION);
357
+    local hasTranscriptionEnabled = room._transcription_languages and room._transcription_languages[occupant.jid];
358
+
356
     -- detect transcription
359
     -- detect transcription
357
-    if full_p:get_child_text(PARTICIPANT_PROP_REQUEST_TRANSCRIPTION) then
360
+    if requestTranscriptionValue == 'true' then
358
         local lang = full_p:get_child_text(PARTICIPANT_PROP_TRANSLATION_LANG);
361
         local lang = full_p:get_child_text(PARTICIPANT_PROP_TRANSLATION_LANG);
359
 
362
 
360
-        occupant._transcription_enabled = true;
361
-
362
         add_transcription(room, occupant, lang);
363
         add_transcription(room, occupant, lang);
363
-    elseif occupant._transcription_enabled then
364
-        occupant._transcription_enabled = false;
364
+    elseif hasTranscriptionEnabled then
365
         remove_transcription(room, occupant, nil);
365
         remove_transcription(room, occupant, nil);
366
     end
366
     end
367
 
367
 

正在加载...
取消
保存