mirror of
https://github.com/bjc/prosody.git
synced 2025-04-04 21:57:45 +03:00
mod_component: Fire event when component disconnects
This commit is contained in:
parent
5092b5f5d2
commit
4b907ce3ff
1 changed files with 1 additions and 0 deletions
|
@ -314,6 +314,7 @@ function listener.ondisconnect(conn, err)
|
|||
local session = sessions[conn];
|
||||
if session then
|
||||
(session.log or log)("info", "component disconnected: %s (%s)", tostring(session.host), tostring(err));
|
||||
module:fire_event("component-disconnected", { session = session, reason = err });
|
||||
if session.on_destroy then session:on_destroy(err); end
|
||||
sessions[conn] = nil;
|
||||
for k in pairs(session) do
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue