diff options
author | Matthew Wild <mwild1@gmail.com> | 2025-02-16 13:44:23 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2025-02-16 13:44:23 +0000 |
commit | 14c171ab612fa55966524c01661de41673683e61 (patch) | |
tree | a6a649ab400937d91cd3fd95bf118aec759f13e0 /core/moduleapi.lua | |
parent | 5c2dbef89da68a8a8312a399649429cad721f6cb (diff) | |
parent | 573e9f27169c5791c81d0548149afca880395bda (diff) | |
download | prosody-14c171ab612fa55966524c01661de41673683e61.tar.gz prosody-14c171ab612fa55966524c01661de41673683e61.zip |
Merge 13.0->trunk
Diffstat (limited to 'core/moduleapi.lua')
-rw-r--r-- | core/moduleapi.lua | 8 |
1 files changed, 6 insertions, 2 deletions
diff --git a/core/moduleapi.lua b/core/moduleapi.lua index b93536b5..50524b32 100644 --- a/core/moduleapi.lua +++ b/core/moduleapi.lua @@ -136,10 +136,14 @@ function api:require(lib) return f(); end -function api:depends(name) +function api:depends(name, soft) local modulemanager = require"prosody.core.modulemanager"; if self:get_option_inherited_set("modules_disabled", {}):contains(name) then - error("Dependency on disabled module mod_"..name); + if not soft then + error("Dependency on disabled module mod_"..name); + end + self:log("debug", "Not loading disabled soft dependency mod_%s", name); + return nil, "disabled"; end if not self.dependencies then self.dependencies = {}; |