core/componentmanager.lua
changeset 217 d522f3a25dda
parent 212 9d6da9ed9063
child 261 790cf21e2af7
--- a/core/componentmanager.lua	Wed Nov 05 03:47:22 2008 +0500
+++ b/core/componentmanager.lua	Tue Nov 04 22:50:32 2008 +0000
@@ -15,7 +15,7 @@
 	if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource
 	if component then
 		log("debug", "stanza being handled by component: "..host);
-		component(origin, stanza);
+		component(origin, stanza, hosts[host]);
 	else
 		log("error", "Component manager recieved a stanza for a non-existing component: " .. stanza.attr.to);
 	end
@@ -25,11 +25,11 @@
 	if not hosts[host] then
 		-- TODO check for host well-formedness
 		components[host] = component;
-		hosts[host] = {type = "component", connected = true};
+		hosts[host] = {type = "component", host = host, connected = true};
 		log("debug", "component added: "..host);
 	else
 		log("error", "Attempt to set component for existing host: "..host);
 	end
 end
 
-return _M;
\ No newline at end of file
+return _M;