Skip to content

Jitsi Meet - Secure, Simple and Scalable Video Conferences that you use as a standalone app or embed in your web application.

Add context user on speaker stats

drimovecz6ecd150f75f5
diff --git a/resources/prosody-plugins/mod_speakerstats_component.lua b/resources/prosody-plugins/mod_speakerstats_component.lua
index eba249f6bf..78d06d11bc 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