Software /
code /
prosody
Comparison
core/servermanager.lua @ 43:03dc9df59368
Reply to unhandled iq's with service-unavailable
author | Matthew Wild <mwild1@gmail.com> |
---|---|
date | Sat, 04 Oct 2008 02:10:14 +0100 |
parent | 30:bcf539295f2d |
child | 111:0abe771b43c6 |
comparison
equal
deleted
inserted
replaced
42:2e3715e30912 | 43:03dc9df59368 |
---|---|
1 | |
2 local st = require "util.stanza"; | |
3 local send = require "core.sessionmanager".send_to_session; | |
4 local xmlns_stanzas ='urn:ietf:params:xml:ns:xmpp-stanzas'; | |
1 | 5 |
2 require "modulemanager" | 6 require "modulemanager" |
3 | 7 |
4 -- Handle stanzas that were addressed to the server (whether they came from c2s, s2s, etc.) | 8 -- Handle stanzas that were addressed to the server (whether they came from c2s, s2s, etc.) |
5 function handle_stanza(origin, stanza) | 9 function handle_stanza(origin, stanza) |
6 -- Use plugins | 10 -- Use plugins |
7 return modulemanager.handle_stanza(origin, stanza); | 11 if not modulemanager.handle_stanza(origin, stanza) then |
12 if stanza.name == "iq" then | |
13 local reply = st.reply(stanza); | |
14 reply.attr.type = "error"; | |
15 reply:tag("error", { type = "cancel" }) | |
16 :tag("service-unavailable", { xmlns = xmlns_stanzas }); | |
17 send(origin, reply); | |
18 end | |
19 end | |
8 end | 20 end |