Software /
code /
prosody
Comparison
core/modulemanager.lua @ 4135:9dfb3c0101b5
modulemanager: Fix disabling a module on a single host
author | Paul Aurich <paul@darkrain42.org> |
---|---|
date | Tue, 01 Feb 2011 17:56:16 -0800 |
parent | 4068:15c4cefb825c |
child | 4151:a1ac8f064dcb |
comparison
equal
deleted
inserted
replaced
4132:ccc16434dbe2 | 4135:9dfb3c0101b5 |
---|---|
66 local host_modules_disabled = config.get(host, "core", "modules_disabled"); | 66 local host_modules_disabled = config.get(host, "core", "modules_disabled"); |
67 | 67 |
68 if host_modules_enabled == global_modules_enabled then host_modules_enabled = nil; end | 68 if host_modules_enabled == global_modules_enabled then host_modules_enabled = nil; end |
69 if host_modules_disabled == global_modules_disabled then host_modules_disabled = nil; end | 69 if host_modules_disabled == global_modules_disabled then host_modules_disabled = nil; end |
70 | 70 |
71 local host_modules = set.new(host_modules_enabled) - set.new(host_modules_disabled); | |
72 local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled); | 71 local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled); |
73 if component then | 72 if component then |
74 global_modules = set.intersection(set.new(component_inheritable_modules), global_modules); | 73 global_modules = set.intersection(set.new(component_inheritable_modules), global_modules); |
75 end | 74 end |
76 local modules = global_modules + host_modules; | 75 local modules = (global_modules + set.new(host_modules_enabled)) - set.new(host_modules_disabled); |
77 | 76 |
78 -- COMPAT w/ pre 0.8 | 77 -- COMPAT w/ pre 0.8 |
79 if modules:contains("console") then | 78 if modules:contains("console") then |
80 log("error", "The mod_console plugin has been renamed to mod_admin_telnet. Please update your config."); | 79 log("error", "The mod_console plugin has been renamed to mod_admin_telnet. Please update your config."); |
81 modules:remove("console"); | 80 modules:remove("console"); |