Changed order of checking for component hosts to check the full and bare JIDs before the hostname

Wed, 24 Dec 2008 05:10:13 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 24 Dec 2008 05:10:13 +0500
changeset 638
1915c64c9436
parent 631
6957fe7b0313
child 639
38cb21431257
child 640
068130563311

Changed order of checking for component hosts to check the full and bare JIDs before the hostname

core/componentmanager.lua file | annotate | diff | comparison | revisions
--- a/core/componentmanager.lua	Fri Dec 19 01:57:13 2008 +0500
+++ b/core/componentmanager.lua	Wed Dec 24 05:10:13 2008 +0500
@@ -31,9 +31,10 @@
 
 function handle_stanza(origin, stanza)
 	local node, host = jid_split(stanza.attr.to);
-	local component = components[host];
+	local component = nil;
+	if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource
 	if not component then component = components[node.."@"..host]; end -- hack to allow hooking node@server
-	if not component then component = components[stanza.attr.to]; end -- hack to allow hooking node@server/resource and server/resource
+	if not component then component = components[host]; end
 	if component then
 		log("debug", "stanza being handled by component: "..host);
 		component(origin, stanza, hosts[host]);

mercurial