aboutsummaryrefslogtreecommitdiffstats
path: root/core/modulemanager.lua
diff options
context:
space:
mode:
Diffstat (limited to 'core/modulemanager.lua')
-rw-r--r--core/modulemanager.lua16
1 files changed, 12 insertions, 4 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua
index 1174352b..8e62aecb 100644
--- a/core/modulemanager.lua
+++ b/core/modulemanager.lua
@@ -1,6 +1,6 @@
-- Prosody IM
--- Copyright (C) 2008-2009 Matthew Wild
--- Copyright (C) 2008-2009 Waqas Hussain
+-- Copyright (C) 2008-2010 Matthew Wild
+-- Copyright (C) 2008-2010 Waqas Hussain
--
-- This project is MIT/X11 licensed. Please see the
-- COPYING file in the source package for more information.
@@ -19,7 +19,7 @@ local pluginloader = require "util.pluginloader";
local hosts = hosts;
local prosody = prosody;
-local loadfile, pcall = loadfile, pcall;
+local loadfile, pcall, xpcall = loadfile, pcall, xpcall;
local setmetatable, setfenv, getfenv = setmetatable, setfenv, getfenv;
local pairs, ipairs = pairs, ipairs;
local t_insert, t_concat = table.insert, table.concat;
@@ -29,6 +29,14 @@ local rawget = rawget;
local error = error;
local tostring, tonumber = tostring, tonumber;
+local debug_traceback = debug.traceback;
+local unpack, select = unpack, select;
+pcall = function(f, ...)
+ local n = select("#", ...);
+ local params = {...};
+ return xpcall(function() f(unpack(params, 1, n)) end, function(e) return tostring(e).."\n"..debug_traceback(); end);
+end
+
local array, set = require "util.array", require "util.set";
local autoload_modules = {"presence", "message", "iq"};
@@ -274,7 +282,7 @@ function handle_stanza(host, origin, stanza)
(handlers[1])(origin, stanza);
return true;
else
- if stanza.attr.xmlns == "jabber:client" then
+ if stanza.attr.xmlns == nil then
log("debug", "Unhandled %s stanza: %s; xmlns=%s", origin.type, stanza.name, xmlns); -- we didn't handle it
if stanza.attr.type ~= "error" and stanza.attr.type ~= "result" then
origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));