Software / code / prosody
Comparison
core/moduleapi.lua @ 8487:91f6815de26a
moduleapi: Warn if a module being loaded as a dependency has been disabled
| author | Kim Alvefur <zash@zash.se> |
|---|---|
| date | Wed, 27 Dec 2017 00:42:57 +0100 |
| parent | 7982:e30b0cbed472 |
| child | 8533:66cdf5c7af85 |
comparison
equal
deleted
inserted
replaced
| 8486:c50101b527bf | 8487:91f6815de26a |
|---|---|
| 159 self:log("info", "Auto-unloading due to unload of %s:%s", event.host, event.module); | 159 self:log("info", "Auto-unloading due to unload of %s:%s", event.host, event.module); |
| 160 modulemanager.unload(self.host, self.name); | 160 modulemanager.unload(self.host, self.name); |
| 161 end | 161 end |
| 162 end); | 162 end); |
| 163 end | 163 end |
| 164 if self:get_option_inherited_set("modules_disabled", {}):contains(name) then | |
| 165 self:log("warn", "Loading prerequisite mod_%s despite it being disabled", name); | |
| 166 end | |
| 164 local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name); | 167 local mod = modulemanager.get_module(self.host, name) or modulemanager.get_module("*", name); |
| 165 if mod and mod.module.host == "*" and self.host ~= "*" | 168 if mod and mod.module.host == "*" and self.host ~= "*" |
| 166 and modulemanager.module_has_method(mod, "add_host") then | 169 and modulemanager.module_has_method(mod, "add_host") then |
| 167 mod = nil; -- Target is a shared module, so we still want to load it on our host | 170 mod = nil; -- Target is a shared module, so we still want to load it on our host |
| 168 end | 171 end |