Fix routing of outbound iq stanzas

Sat, 15 Nov 2008 19:13:28 +0000

author
Matthew Wild <mwild1@gmail.com>
date
Sat, 15 Nov 2008 19:13:28 +0000
changeset 274
9e68a697435d
parent 273
b4c6b124c06f
child 275
7af22e56d625

Fix routing of outbound iq stanzas

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Sat Nov 15 19:12:23 2008 +0000
+++ b/core/stanza_router.lua	Sat Nov 15 19:13:28 2008 +0000
@@ -50,7 +50,7 @@
 		error("Client MUST bind resource after auth");
 	end
 
-	-- TODO also, stazas should be returned to their original state before the function ends
+	-- TODO also, stanzas should be returned to their original state before the function ends
 	if origin.type == "c2s" then
 		stanza.attr.from = origin.full_jid;
 	end
@@ -88,7 +88,7 @@
 			component_handle_stanza(origin, stanza);
 		elseif origin.type == "c2s" and stanza.name == "presence" and stanza.attr.type ~= nil and stanza.attr.type ~= "unavailable" then
 			handle_outbound_presence_subscriptions_and_probes(origin, stanza, from_bare, to_bare);
-		elseif stanza.name == "iq" and not resource then -- directed at bare JID
+		elseif origin.type ~= "c2s" and stanza.name == "iq" and not resource then -- directed at bare JID
 			core_handle_stanza(origin, stanza);
 		else
 			core_route_stanza(origin, stanza);

mercurial