Add context user on speaker stats

This commit is contained in:
drimovecz 2019-10-23 10:58:14 +03:00 committed by Дамян Минков
parent 02fb37189b
commit 6ecd150f75
1 changed files with 6 additions and 3 deletions

View File

@ -62,11 +62,12 @@ end
local SpeakerStats = {};
SpeakerStats.__index = SpeakerStats;
function new_SpeakerStats(nick)
function new_SpeakerStats(nick, context_user)
return setmetatable({
totalDominantSpeakerTime = 0;
_dominantSpeakerStart = 0;
nick = nick;
context_user = context_user;
displayName = nil;
}, SpeakerStats);
end
@ -106,6 +107,7 @@ end
function occupant_joined(event)
local room = event.room;
local occupant = event.occupant;
local nick = jid_resource(occupant.nick);
if room.speakerStats then
@ -150,7 +152,8 @@ function occupant_joined(event)
room:route_stanza(stanza);
end
room.speakerStats[occupant.jid] = new_SpeakerStats(nick);
local context_user = event.origin and event.origin.jitsi_meet_context_user or nil;
room.speakerStats[occupant.jid] = new_SpeakerStats(nick, context_user);
end
end
@ -200,4 +203,4 @@ if prosody.hosts[muc_component_host] == nil then
prosody.events.add_handler("host-activated", process_host);
else
process_host(muc_component_host);
end
end