Re-applying my changes to componentmanager. Sigh.

Tue, 04 Nov 2008 22:50:32 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Tue, 04 Nov 2008 22:50:32 +0000
changeset 217
d522f3a25dda
parent 216
35f626e29fb0
child 218
1263896ab2f1

Re-applying my changes to componentmanager. Sigh.

core/componentmanager.lua file | annotate | diff | comparison | revisions
--- 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;

mercurial