aboutsummaryrefslogtreecommitdiffstats
path: root/core/stanza_router.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-04 22:12:12 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-04 22:12:12 +0500
commit1d7b68a237147803acfc2829cb5e0c4b44253618 (patch)
treea4afb14eba6ee5a0299aa675261ba63e569c4bca /core/stanza_router.lua
parentc6ec71bee0acf47e0581ad0c1dad2ed47b59dc8a (diff)
parent269a562f52e2d404c4d49122436029d07d17711c (diff)
downloadprosody-1d7b68a237147803acfc2829cb5e0c4b44253618.tar.gz
prosody-1d7b68a237147803acfc2829cb5e0c4b44253618.zip
Merge with 0.5
Diffstat (limited to 'core/stanza_router.lua')
-rw-r--r--core/stanza_router.lua6
1 files changed, 5 insertions, 1 deletions
diff --git a/core/stanza_router.lua b/core/stanza_router.lua
index 41d09553..e8ade0e1 100644
--- a/core/stanza_router.lua
+++ b/core/stanza_router.lua
@@ -26,9 +26,13 @@ function core_process_stanza(origin, stanza)
-- TODO verify validity of stanza (as well as JID validity)
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
+ local can_reply = stanza.attr.type == "set" or stanza.attr.type == "get"
+ local missing_id = not stanza.attr.id;
+ if can_reply and (#stanza.tags ~= 1 or missing_id) then
origin.send(st.error_reply(stanza, "modify", "bad-request"));
return;
+ elseif missing_id then
+ return;
end
end