Changeset

2876:fa84451e9b35

stanza_router: Don't send error replies for stanzas of type 'error' and 'result' on unbound authenticated connections.
author Waqas Hussain <waqas20@gmail.com>
date Thu, 04 Mar 2010 02:22:45 +0500
parents 2875:2c538d4bde13
children 2877:1edeb8fe7d14
files core/stanza_router.lua
diffstat 1 files changed, 3 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/core/stanza_router.lua	Thu Mar 04 02:20:17 2010 +0500
+++ b/core/stanza_router.lua	Thu Mar 04 02:22:45 2010 +0500
@@ -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