From 6ecd150f75f59eb62a6fce38cf90b764494d02c4 Mon Sep 17 00:00:00 2001 From: drimovecz Date: Wed, 23 Oct 2019 10:58:14 +0300 Subject: [PATCH] Add context user on speaker stats --- resources/prosody-plugins/mod_speakerstats_component.lua | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/resources/prosody-plugins/mod_speakerstats_component.lua b/resources/prosody-plugins/mod_speakerstats_component.lua index eba249f6b..78d06d11b 100644 --- a/resources/prosody-plugins/mod_speakerstats_component.lua +++ b/resources/prosody-plugins/mod_speakerstats_component.lua @@ -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 \ No newline at end of file