2 local st = require "util.stanza";
3 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas';
5 local modulemanager = require "core.modulemanager";
7 -- Handle stanzas that were addressed to the server (whether they came from c2s, s2s, etc.)
8 function handle_stanza(origin, stanza)
10 if not modulemanager.handle_stanza(origin, stanza) then
11 if stanza.name == "iq" then
12 if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
13 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
15 elseif stanza.name == "message" then
16 origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));
17 elseif stanza.name ~= "presence" then
18 error("Unknown stanza");