Diff

plugins/mod_component.lua @ 7666:03aa330562ed

Merge 0.10->trunk
author Matthew Wild <mwild1@gmail.com>
date Mon, 12 Sep 2016 22:31:25 +0100
parent 7359:a5a080c12c96
parent 7665:2e553f80aedd
child 7874:de3c6fb74759
line wrap: on
line diff
--- a/plugins/mod_component.lua	Sun Sep 11 14:54:16 2016 +0200
+++ b/plugins/mod_component.lua	Mon Sep 12 22:31:25 2016 +0100
@@ -314,7 +314,9 @@
 	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