Software /
code /
prosody
Comparison
core/stanza_router.lua @ 1178:f332c033bfc8
stanza_router: Remove FIXME and replace with meaningful comment
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 16 May 2009 20:19:15 +0100 |
parent | 1172:490ff24d0ac5 |
child | 1179:503d68e7e18a |
comparison
equal
deleted
inserted
replaced
1177:97ecfcec2d71 | 1178:f332c033bfc8 |
---|---|
45 local fire_event = require "core.eventmanager2".fire_event; | 45 local fire_event = require "core.eventmanager2".fire_event; |
46 | 46 |
47 function core_process_stanza(origin, stanza) | 47 function core_process_stanza(origin, stanza) |
48 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) | 48 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:top_tag()) |
49 | 49 |
50 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. | 50 -- Currently we guarantee every stanza to have an xmlns, should we keep this rule? |
51 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end | |
52 | |
51 -- TODO verify validity of stanza (as well as JID validity) | 53 -- TODO verify validity of stanza (as well as JID validity) |
52 if stanza.attr.type == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log | 54 if stanza.attr.type == "error" and #stanza.tags == 0 then return; end -- TODO invalid stanza, log |
53 if stanza.name == "iq" then | 55 if stanza.name == "iq" then |
54 if (stanza.attr.type == "set" or stanza.attr.type == "get") and #stanza.tags ~= 1 then | 56 if (stanza.attr.type == "set" or stanza.attr.type == "get") and #stanza.tags ~= 1 then |
55 origin.send(st.error_reply(stanza, "modify", "bad-request")); | 57 origin.send(st.error_reply(stanza, "modify", "bad-request")); |