stanza_router: Fixed an invalid stanza check

Fri, 15 May 2009 07:04:41 +0500

author
Waqas Hussain <waqas20@gmail.com>
date
Fri, 15 May 2009 07:04:41 +0500
changeset 1152
4d95e8078405
parent 1151
8096941b6734
child 1153
1184cb19b6f2

stanza_router: Fixed an invalid stanza check

core/stanza_router.lua file | annotate | diff | comparison | revisions
--- a/core/stanza_router.lua	Fri May 15 06:39:53 2009 +0500
+++ b/core/stanza_router.lua	Fri May 15 07:04:41 2009 +0500
@@ -54,7 +54,7 @@
 
 	if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling.
 	-- TODO verify validity of stanza (as well as JID validity)
-	if stanza.attr.xmlns == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log
+	if stanza.attr.type == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log
 	if stanza.name == "iq" then
 		if (stanza.attr.type == "set" or stanza.attr.type == "get") and #stanza.tags ~= 1 then
 			origin.send(st.error_reply(stanza, "modify", "bad-request"));

mercurial