aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-03-18 13:58:55 +0000
committerMatthew Wild <mwild1@gmail.com>2016-03-18 13:58:55 +0000
commit4b4e0feb6e50edf7c7958a670cb9f9fb1c304317 (patch)
tree5be6e0732884b7d0282bf9e3b3a778c630725a9b
parent693b11c7b296abfed939fa031f35a58d85eedacf (diff)
downloadprosody-4b4e0feb6e50edf7c7958a670cb9f9fb1c304317.tar.gz
prosody-4b4e0feb6e50edf7c7958a670cb9f9fb1c304317.zip
mod_component: Fire event when component disconnects
-rw-r--r--plugins/mod_component.lua1
1 files changed, 1 insertions, 0 deletions
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