From 4b907ce3ffd17d7f2a1464156fd186506e6904c8 Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 18 Mar 2016 13:58:55 +0000 Subject: mod_component: Fire event when component disconnects --- plugins/mod_component.lua | 1 + 1 file changed, 1 insertion(+) (limited to 'plugins') diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua index a5136f6c..7709d185 100644 --- a/plugins/mod_component.lua +++ b/plugins/mod_component.lua @@ -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 -- cgit v1.2.3