aboutsummaryrefslogtreecommitdiffstats
path: root/core/hostmanager.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2010-11-10 19:57:35 +0500
committerWaqas Hussain <waqas20@gmail.com>2010-11-10 19:57:35 +0500
commitd1706d1cb578ea661f52564d271968b76b088af1 (patch)
treeb6cd96d7d3b4932d888e45f1cd08827532901552 /core/hostmanager.lua
parent24245b60d112dcee347bf7c073b4715782ca0c23 (diff)
downloadprosody-d1706d1cb578ea661f52564d271968b76b088af1.tar.gz
prosody-d1706d1cb578ea661f52564d271968b76b088af1.zip
hostmanager, componentmanager: hostmanager now handles component initialization at server start, not componentmanager.
Diffstat (limited to 'core/hostmanager.lua')
-rw-r--r--core/hostmanager.lua8
1 files changed, 6 insertions, 2 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua
index 71bc723e..0c91dd80 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -32,8 +32,10 @@ local function load_enabled_hosts(config)
local activated_any_host;
for host, host_config in pairs(defined_hosts) do
- if host ~= "*" and host_config.core.enabled ~= false and not host_config.core.component_module then
- activated_any_host = true;
+ if host ~= "*" and host_config.core.enabled ~= false then
+ if not host_config.core.component_module then
+ activated_any_host = true;
+ end
activate(host, host_config);
end
end
@@ -49,6 +51,7 @@ end
prosody_events.add_handler("server-starting", load_enabled_hosts);
function activate(host, host_config)
+ if hosts[host] then return nil, "host-already-exists"; end
local host_session = {
host = host;
s2sout = {};
@@ -74,6 +77,7 @@ function activate(host, host_config)
log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host);
prosody_events.fire_event("host-activated", host, host_config);
+ return true;
end
function deactivate(host, reason)