Merge 0.10->trunk
[prosody.git] / core / modulemanager.lua
index 5d030513f0ac6f08dc6246f62918f471b03b4b4c..7bed17950e0c435eeac929d4cde535c153a00649 100644 (file)
@@ -24,7 +24,7 @@ local ipairs, pairs, type, tostring, t_insert = ipairs, pairs, type, tostring, t
 
 local debug_traceback = debug.traceback;
 local select = select;
-local unpack = table.unpack or unpack;
+local unpack = table.unpack or unpack; --luacheck: ignore 113
 local pcall = function(f, ...)
        local n = select("#", ...);
        local params = {...};
@@ -125,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];