diff options
author | Matthew Wild <mwild1@gmail.com> | 2008-10-04 02:09:46 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2008-10-04 02:09:46 +0100 |
commit | 9d19964c829659b3b25ef472f899d9702b2add2f (patch) | |
tree | 8cb40db2ab408d9c29305852ec4ec92f22b51070 | |
parent | c0f3a8153a70190a026f636eb5df98773ce393cf (diff) | |
download | prosody-9d19964c829659b3b25ef472f899d9702b2add2f.tar.gz prosody-9d19964c829659b3b25ef472f899d9702b2add2f.zip |
Small fixes
-rw-r--r-- | core/modulemanager.lua | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/core/modulemanager.lua b/core/modulemanager.lua index 2779746e..78faad92 100644 --- a/core/modulemanager.lua +++ b/core/modulemanager.lua @@ -19,6 +19,7 @@ local handlers = {}; 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 @@ function modulehelpers.add_iq_handler(origin_type, xmlns, handler) 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 @@ function handle_stanza(origin, stanza) 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 |