Software /
code /
prosody
Comparison
core/stanza_router.lua @ 897:aeb05598dec1
Merge
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Fri, 20 Mar 2009 20:17:05 +0000 |
parent | 896:2c0b9e3c11c3 |
parent | 894:b61c3589cd7b |
child | 898:8176d224208a |
comparison
equal
deleted
inserted
replaced
896:2c0b9e3c11c3 | 897:aeb05598dec1 |
---|---|
49 function core_process_stanza(origin, stanza) | 49 function core_process_stanza(origin, stanza) |
50 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) | 50 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) |
51 | 51 |
52 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. | 52 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. |
53 -- TODO verify validity of stanza (as well as JID validity) | 53 -- TODO verify validity of stanza (as well as JID validity) |
54 if stanza.name == "iq" and not(#stanza.tags == 1 and stanza.tags[1].attr.xmlns) then | 54 if stanza.name == "iq" and #stanza.tags > 1 then |
55 if stanza.attr.type == "set" or stanza.attr.type == "get" then | 55 if stanza.attr.type == "set" or stanza.attr.type == "get" then |
56 error("Invalid IQ"); | |
57 elseif #stanza.tags > 1 and not(stanza.attr.type == "error" or stanza.attr.type == "result") then | |
58 error("Invalid IQ"); | 56 error("Invalid IQ"); |
59 end | 57 end |
60 end | 58 end |
61 | 59 |
62 if origin.type == "c2s" and not origin.full_jid | 60 if origin.type == "c2s" and not origin.full_jid |