projects
/
prosody.git
/ blobdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
raw
|
inline
| side by side
mod_bosh: Use util.timer for timers instead of server.addtimer.
[prosody.git]
/
core
/
modulemanager.lua
diff --git
a/core/modulemanager.lua
b/core/modulemanager.lua
index d64718507709c137b8129e33f9564008b4f268e0..b12cddf0e858f26d490425964af1c9c7d6a89719 100644
(file)
--- a/
core/modulemanager.lua
+++ b/
core/modulemanager.lua
@@
-40,7
+40,7
@@
end
local array, set = require "util.array", require "util.set";
local autoload_modules = {"presence", "message", "iq"};
local array, set = require "util.array", require "util.set";
local autoload_modules = {"presence", "message", "iq"};
-local component_inheritable_modules = {"tls", "dialback"};
+local component_inheritable_modules = {"tls", "dialback"
, "iq"
};
-- We need this to let modules access the real global namespace
local _G = _G;
-- We need this to let modules access the real global namespace
local _G = _G;
@@
-73,7
+73,7
@@
function load_modules_for_host(host)
local host_modules = set.new(host_modules_enabled) - set.new(host_modules_disabled);
local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled);
if component then
local host_modules = set.new(host_modules_enabled) - set.new(host_modules_disabled);
local global_modules = set.new(autoload_modules) + set.new(global_modules_enabled) - set.new(global_modules_disabled);
if component then
- global_modules = set.
new(component_inheritable_modules) - global_modules
;
+ global_modules = set.
intersection(set.new(component_inheritable_modules), global_modules)
;
end
local modules = global_modules + host_modules;
end
local modules = global_modules + host_modules;
@@
-85,12
+85,13
@@
function load_modules_for_host(host)
end
end
prosody_events.add_handler("host-activated", load_modules_for_host);
end
end
prosody_events.add_handler("host-activated", load_modules_for_host);
-prosody_events.add_handler("component-activated", load_modules_for_host);
--
function load(host, module_name, config)
if not (host and module_name) then
return nil, "insufficient-parameters";
--
function load(host, module_name, config)
if not (host and module_name) then
return nil, "insufficient-parameters";
+ elseif not hosts[host] then
+ return nil, "unknown-host";
end
if not modulemap[host] then
end
if not modulemap[host] then
@@
-118,11
+119,6
@@
function load(host, module_name, config)
api_instance.environment = pluginenv;
setfenv(mod, pluginenv);
api_instance.environment = pluginenv;
setfenv(mod, pluginenv);
- if not hosts[host] then
- local create_component = _G.require "core.componentmanager".create_component;
- hosts[host] = create_component(host);
- log("debug", "Created new component: %s", host);
- end
hosts[host].modules = modulemap[host];
modulemap[host][module_name] = pluginenv;
hosts[host].modules = modulemap[host];
modulemap[host][module_name] = pluginenv;