ソースを参照

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,15 +353,15 @@ module:hook('muc-broadcast-presence', function (event)
353 353
         module:send(promotion_request);
354 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 359
     -- detect transcription
357
-    if full_p:get_child_text(PARTICIPANT_PROP_REQUEST_TRANSCRIPTION) then
360
+    if requestTranscriptionValue == 'true' then
358 361
         local lang = full_p:get_child_text(PARTICIPANT_PROP_TRANSLATION_LANG);
359 362
 
360
-        occupant._transcription_enabled = true;
361
-
362 363
         add_transcription(room, occupant, lang);
363
-    elseif occupant._transcription_enabled then
364
-        occupant._transcription_enabled = false;
364
+    elseif hasTranscriptionEnabled then
365 365
         remove_transcription(room, occupant, nil);
366 366
     end
367 367
 

読み込み中…
キャンセル
保存