Changeset

217:d522f3a25dda

Re-applying my changes to componentmanager. Sigh.
author Matthew Wild <mwild1@gmail.com>
date Tue, 04 Nov 2008 22:50:32 +0000
parents 216:35f626e29fb0
children 218:1263896ab2f1
files core/componentmanager.lua
diffstat 1 files changed, 3 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- 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;