aboutsummaryrefslogtreecommitdiffstats
path: root/core/servermanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2008-10-22 21:20:29 +0500
committerWaqas Hussain <waqas20@gmail.com>2008-10-22 21:20:29 +0500
commitdffccde8c2a3cfef6353400ecb15572022704a6e (patch)
tree1f8543c4b8ea64a04933b67ff23b94f5b786a47c /core/servermanager.lua
parent9595202d474b7c2dd6654603cc81818b53682e87 (diff)
downloadprosody-dffccde8c2a3cfef6353400ecb15572022704a6e.tar.gz
prosody-dffccde8c2a3cfef6353400ecb15572022704a6e.zip
Fixed: Unhandled stanza handling
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