Collect speaker stats for same user from previouse sessions based on user ID

When user leaves and rejoins conference we can see his name twice in the speaker stats.
Does anybody have an idea how to collect stats from previous sessions for the same user?

I have configured JWT token authentication and added few debug lines in mod_speakerstats_component.lua and I can see in Prosody logs that user has same “bare_jid” field in prosody every time he connects but his nick is different every time. This nick is what I see in Jitsi as userId on the frontend.

Can I somehow fetch stats from previous session based on same “bare_jid” and use that as a starting point for new session?

I can’t find that piece of code where Jitsi Meet creates local speaker stats when user joins the conference :-(.