core/stanza_router.lua

changeset 725
96110075288b
parent 718
aa78dfb26593
child 726
68a776711ba9
equal deleted inserted replaced
724:8beae443867f 725:96110075288b
54 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error? 54 origin.send(st.error_reply(stanza, "cancel", "service-unavailable")); -- FIXME correct error?
55 end 55 end
56 end 56 end
57 57
58 function core_process_stanza(origin, stanza) 58 function core_process_stanza(origin, stanza)
59 (origin.log or log)("debug", "Received[%s]: %s", origin.type, stanza:pretty_print()) --top_tag()) 59 (origin.log or log)("debug", "Received[%s]: %s", origin.type, top_tag())
60 60
61 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling. 61 if not stanza.attr.xmlns then stanza.attr.xmlns = "jabber:client"; end -- FIXME Hack. This should be removed when we fix namespace handling.
62 -- TODO verify validity of stanza (as well as JID validity) 62 -- TODO verify validity of stanza (as well as JID validity)
63 if stanza.name == "iq" and not(#stanza.tags == 1 and stanza.tags[1].attr.xmlns) then 63 if stanza.name == "iq" and not(#stanza.tags == 1 and stanza.tags[1].attr.xmlns) then
64 if stanza.attr.type == "set" or stanza.attr.type == "get" then 64 if stanza.attr.type == "set" or stanza.attr.type == "get" then

mercurial