aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2012-04-23 14:15:07 +0100
committerMatthew Wild <mwild1@gmail.com>2012-04-23 14:15:07 +0100
commit33ffda321d20938d4a28b15716d4f85871b4e6a7 (patch)
tree990d4b17fb3959ce42fe3bc2d34f5c87514dc4c9 /core/moduleapi.lua
parentc40ee817429487a325e871da5ddc3e43eab19bb5 (diff)
downloadprosody-33ffda321d20938d4a28b15716d4f85871b4e6a7.tar.gz
prosody-33ffda321d20938d4a28b15716d4f85871b4e6a7.zip
moduleapi: module:depends(): Load shared modules onto the current host even if they are loaded globally already
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua3
1 files changed, 3 insertions, 0 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index 2223f4d0..e680f615 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -120,6 +120,9 @@ function api:depends(name)
end);
end
local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name);
+ if mod and mod.module.host == "*" and modulemanager.module_has_method(mod, "add_host") then
+ mod = nil; -- This is a shared module, so we still want to load it on our host
+ end
if not mod then
local err;
mod, err = modulemanager.load(self.host, name);