Fixed: Some presence stanzas from local users were not being routed correctly to components (ghosts in mod_muc)

Wed, 11 Feb 2009 18:11:41 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Wed, 11 Feb 2009 18:11:41 +0500
changeset 781
191b9f0e5485
parent 780
4417ab6ccc20
child 782
6f9b2a9d6d45

Fixed: Some presence stanzas from local users were not being routed correctly to components (ghosts in mod_muc)

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Wed Feb 11 18:09:41 2009 +0500
+++ b/core/stanza_router.lua	Wed Feb 11 18:11:41 2009 +0500
@@ -178,6 +178,14 @@
 	origin = origin or hosts[from_host];
 	if not origin then return false; end
 	
+	if hosts[to] and hosts[to].type == "component" then -- hack to allow components to handle node@server/resource and server/resource
+		return component_handle_stanza(origin, stanza);
+	elseif hosts[to_bare] and hosts[to_bare].type == "component" then -- hack to allow components to handle node@server
+		return component_handle_stanza(origin, stanza);
+	elseif hosts[host] and hosts[host].type == "component" then -- directed at a component
+		return component_handle_stanza(origin, stanza);
+	end
+
 	if stanza.name == "presence" and (stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable") then resource = nil; end
 
 	local host_session = hosts[host]

mercurial