stanza_router: Don't send error replies for stanzas of type 'error' and 'result' on unbound authenticated connections. [originally fa84451e9b35 in 0.6]

Mon, 22 Mar 2010 15:05:05 +0000

author
Waqas Hussain <waqas20@gmail.com>
date
Mon, 22 Mar 2010 15:05:05 +0000
changeset 2918
79ca9f686aaf
parent 2917
2a6552b22f01
child 2919
8ce6b680975a
child 2925
692b3c6c5bd2

stanza_router: Don't send error replies for stanzas of type 'error' and 'result' on unbound authenticated connections. [originally fa84451e9b35 in 0.6]

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Mon Mar 22 15:04:22 2010 +0000
+++ b/core/stanza_router.lua	Mon Mar 22 15:05:05 2010 +0000
@@ -41,7 +41,9 @@
 			and not(stanza.name == "iq" and stanza.attr.type == "set" and stanza.tags[1] and stanza.tags[1].name == "bind"
 					and stanza.tags[1].attr.xmlns == "urn:ietf:params:xml:ns:xmpp-bind") then
 			-- authenticated client isn't bound and current stanza is not a bind request
-			origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server
+			if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
+				origin.send(st.error_reply(stanza, "auth", "not-authorized")); -- FIXME maybe allow stanzas to account or server
+			end
 			return;
 		end
 

mercurial