I’m developing a custom prosody module to monitor
muc-room-destroyed events. To do so I enabled token authentication and now I need to access
session.auth_token inside these events so I can make a request to my monitoring API.
I can successfully get
muc-occupant-left like this:
module:hook("muc-occupant-joined", function (event) local stanza = event.stanza; if not stanza then return -- No such stanza end local session = prosody.full_sessions[stanza.attr.from]; -- do the API call using session.auth_token end);
muc-room-destroyed events I get focus’ stanza and therefore can’t access
I found this topic but for some reason it doesn’t work. I get only focus as occupant.
I also tried logging all join and leave events and I found that focus is joining the room first and leaving last. I’m not that familiar with Prosody and Jitsi but maybe it has to do something with the stanza in
muc-room-destroyed events. If it’s so is there an option to disable this behaviour or other ways of getting