fix(speaker-stats): calculate total dominant speaker time if user is dominant and has no previous speaker time

This commit is contained in:
Gabriel Borlea 2021-11-01 14:22:23 +02:00 committed by Дамян Минков
parent eaa084722f
commit af01072827
1 changed files with 1 additions and 1 deletions

View File

@ -151,7 +151,7 @@ function occupant_joined(event)
-- and skip focus if sneaked into the table
if values.nick ~= nil and values.nick ~= 'focus' then
local totalDominantSpeakerTime = values.totalDominantSpeakerTime;
if totalDominantSpeakerTime > 0 or room:get_occupant_jid(jid) == nil then
if totalDominantSpeakerTime > 0 or room:get_occupant_jid(jid) == nil or values:isDominantSpeaker() then
-- before sending we need to calculate current dominant speaker state
if values:isDominantSpeaker() then
local timeElapsed = math.floor(socket.gettime()*1000 - values._dominantSpeakerStart);