Merge 0.10->trunk
[prosody.git] / core / modulemanager.lua
index 41c9b2fe97eacebb02a8322aee0728c4a2674386..7bed17950e0c435eeac929d4cde535c153a00649 100644 (file)
@@ -23,7 +23,8 @@ local setmetatable, rawget = setmetatable, rawget;
 local ipairs, pairs, type, tostring, t_insert = ipairs, pairs, type, tostring, table.insert;
 
 local debug_traceback = debug.traceback;
-local unpack, select = unpack, select;
+local select = select;
+local unpack = table.unpack or unpack; --luacheck: ignore 113
 local pcall = function(f, ...)
        local n = select("#", ...);
        local params = {...};
@@ -124,7 +125,9 @@ local function do_load_module(host, module_name, state)
        end
 
        if modulemap[host][module_name] then
-               log("debug", "%s is already loaded for %s, so not loading again", module_name, host);
+               if not modulemap["*"][module_name] then
+                       log("debug", "%s is already loaded for %s, so not loading again", module_name, host);
+               end
                return nil, "module-already-loaded";
        elseif modulemap["*"][module_name] then
                local mod = modulemap["*"][module_name];