From dffccde8c2a3cfef6353400ecb15572022704a6e Mon Sep 17 00:00:00 2001 From: Waqas Hussain Date: Wed, 22 Oct 2008 21:20:29 +0500 Subject: Fixed: Unhandled stanza handling --- core/servermanager.lua | 12 +++++++----- 1 file changed, 7 insertions(+), 5 deletions(-) (limited to 'core') 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 -- cgit v1.2.3