aboutsummaryrefslogtreecommitdiffstats
path: root/core/servermanager.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2008-10-22 23:12:26 +0100
committerMatthew Wild <mwild1@gmail.com>2008-10-22 23:12:26 +0100
commite92bd250d19de43dfe0584108d12577bbe1a1c2a (patch)
tree01823b0990afedda8cc7ca448f9f975cd6e9d936 /core/servermanager.lua
parentee7b432ab1d450a42fae24b37c79b7fbda7f4e6b (diff)
parentc3ca55e0195d03c3e0c23590c387c49068be7723 (diff)
downloadprosody-e92bd250d19de43dfe0584108d12577bbe1a1c2a.tar.gz
prosody-e92bd250d19de43dfe0584108d12577bbe1a1c2a.zip
Merge roster & presence from waqas
Diffstat (limited to 'core/servermanager.lua')
-rw-r--r--core/servermanager.lua12
1 files changed, 7 insertions, 5 deletions
diff --git a/core/servermanager.lua b/core/servermanager.lua
index c1e075db..aba3f5d5 100644
--- a/core/servermanager.lua
+++ b/core/servermanager.lua
@@ -10,11 +10,13 @@ function handle_stanza(origin, stanza)
-- Use plugins
if not modulemanager.handle_stanza(origin, stanza) then
if stanza.name == "iq" then
- local reply = st.reply(stanza);
- reply.attr.type = "error";
- reply:tag("error", { type = "cancel" })
- :tag("service-unavailable", { xmlns = xmlns_stanzas });
- send(origin, reply);
+ if stanza.attr.type ~= "result" and stanza.attr.type ~= "error" then
+ send(origin, st.error_reply(stanza, "cancel", "service-unavailable"));
+ end
+ elseif stanza.name == "message" then
+ send(origin, st.error_reply(stanza, "cancel", "service-unavailable"));
+ elseif stanza.name ~= "presence" then
+ error("Unknown stanza");
end
end
end