aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_component.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2016-09-12 22:31:25 +0100
committerMatthew Wild <mwild1@gmail.com>2016-09-12 22:31:25 +0100
commitf4690a6063ec7940ef304691906fdfdebb57eab6 (patch)
tree1b740492720e5c386b928514e711e90e705f5693 /plugins/mod_component.lua
parent0e971a43895405f996ea49fc70142ec9ba182cc1 (diff)
parentcd10e4439e1c9b6209f87bb6c77e51fb2f7992fc (diff)
downloadprosody-f4690a6063ec7940ef304691906fdfdebb57eab6.tar.gz
prosody-f4690a6063ec7940ef304691906fdfdebb57eab6.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_component.lua')
-rw-r--r--plugins/mod_component.lua4
1 files changed, 3 insertions, 1 deletions
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 340faec0..2ef2533b 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -314,7 +314,9 @@ 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.host then
+ module:context(session.host):fire_event("component-disconnected", { session = session, reason = err });
+ end
if session.on_destroy then session:on_destroy(err); end
sessions[conn] = nil;
for k in pairs(session) do