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 | 4b907ce3ffd17d7f2a1464156fd186506e6904c8 (patch) | |
tree | 5be6e0732884b7d0282bf9e3b3a778c630725a9b /plugins | |
parent | 5092b5f5d2b4a0ae0d8812fa09817b314e995969 (diff) | |
download | prosody-4b907ce3ffd17d7f2a1464156fd186506e6904c8.tar.gz prosody-4b907ce3ffd17d7f2a1464156fd186506e6904c8.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 |