# HG changeset patch # User Matthew Wild # Date 1223082586 -3600 # Node ID 2e3715e30912a83d2c0681dd64d25655c8a64914 # Parent 68297fef35ff0cea24b85c408cceae4e03218f98 Small fixes diff -r 68297fef35ff -r 2e3715e30912 core/modulemanager.lua --- a/core/modulemanager.lua Fri Oct 03 22:21:01 2008 +0100 +++ b/core/modulemanager.lua Sat Oct 04 02:09:46 2008 +0100 @@ -19,6 +19,7 @@ local modulehelpers = setmetatable({}, { __index = _G }); function modulehelpers.add_iq_handler(origin_type, xmlns, handler) + if not (origin_type and handler and xmlns) then return false; end handlers[origin_type] = handlers[origin_type] or {}; handlers[origin_type].iq = handlers[origin_type].iq or {}; if not handlers[origin_type].iq[xmlns] then @@ -30,7 +31,8 @@ end end -function modulehelpers.add_handler(origin_type, tag, handler) +function modulehelpers.add_handler(origin_type, tag, xmlns, handler) + if not (origin_type and tag and xmlns and handler) then return false; end handlers[origin_type] = handlers[origin_type] or {}; if not handlers[origin_type][tag] then handlers[origin_type][tag]= handler; @@ -80,7 +82,6 @@ end end - --FIXME: All iq's must be replied to, here we should return service-unavailable I think elseif handlers[origin_type] then local handler = handlers[origin_type][name]; if handler then