diff options
author | Matthew Wild <mwild1@gmail.com> | 2016-03-18 13:58:55 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2016-03-18 13:58:55 +0000 |
commit | 4b4e0feb6e50edf7c7958a670cb9f9fb1c304317 (patch) | |
tree | 5be6e0732884b7d0282bf9e3b3a778c630725a9b /plugins | |
parent | 693b11c7b296abfed939fa031f35a58d85eedacf (diff) | |
download | prosody-4b4e0feb6e50edf7c7958a670cb9f9fb1c304317.tar.gz prosody-4b4e0feb6e50edf7c7958a670cb9f9fb1c304317.zip |
mod_component: Fire event when component disconnects
Diffstat (limited to 'plugins')
-rw-r--r-- | plugins/mod_component.lua | 1 |
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 |