aboutsummaryrefslogtreecommitdiffstats
path: root/core/moduleapi.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2018-10-25 17:11:10 +0200
committerKim Alvefur <zash@zash.se>2018-10-25 17:11:10 +0200
commit5336659f027942575d411946b1ef0f8f700d9337 (patch)
tree4aa853e48697a1169b6190e0b582bf9b1da80c01 /core/moduleapi.lua
parent96b05cc65aaf6f3dc179d653bab4fe83966dd1af (diff)
downloadprosody-5336659f027942575d411946b1ef0f8f700d9337.tar.gz
prosody-5336659f027942575d411946b1ef0f8f700d9337.zip
moduleapi: Prevent loading disabled module as dependency of enabled one
Explicitly disabled module should stay disabled.
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r--core/moduleapi.lua6
1 files changed, 3 insertions, 3 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua
index c19594c1..10f9f04d 100644
--- a/core/moduleapi.lua
+++ b/core/moduleapi.lua
@@ -129,6 +129,9 @@ end
function api:depends(name)
local modulemanager = require"core.modulemanager";
+ if self:get_option_inherited_set("modules_disabled", {}):contains(name) then
+ error("Dependency on disabled module mod_"..name);
+ end
if not self.dependencies then
self.dependencies = {};
self:hook("module-reloaded", function (event)
@@ -145,9 +148,6 @@ function api:depends(name)
end
end);
end
- if self:get_option_inherited_set("modules_disabled", {}):contains(name) then
- self:log("warn", "Loading prerequisite mod_%s despite it being disabled", name);
- end
local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name);
if mod and mod.module.host == "*" and self.host ~= "*"
and modulemanager.module_has_method(mod, "add_host") then