# HG changeset patch # User Waqas Hussain # Date 1289392634 -18000 # Node ID d3b57562cd877e9e8bbd8cf9e7e5306401521174 # Parent 58a4af582eb3da5a691db686b67d0c7e641a84f3 hostmanager: Added support for components to hostmanager.activate(). diff -r 58a4af582eb3 -r d3b57562cd87 core/hostmanager.lua --- a/core/hostmanager.lua Wed Nov 10 06:27:35 2010 +0500 +++ b/core/hostmanager.lua Wed Nov 10 17:37:14 2010 +0500 @@ -49,13 +49,23 @@ prosody_events.add_handler("server-starting", load_enabled_hosts); function activate(host, host_config) - hosts[host] = {type = "local", sessions = {}, - host = host, s2sout = {}, events = events_new(), - disallow_s2s = configmanager.get(host, "core", "disallow_s2s") - or (configmanager.get(host, "core", "anonymous_login") - and (configmanager.get(host, "core", "disallow_s2s") ~= false)); - dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(); - }; + local host_session = { + host = host; + s2sout = {}; + events = events_new(); + dialback_secret = configmanager.get(host, "core", "dialback_secret") or uuid_gen(); + disallow_s2s = configmanager.get(host, "core", "disallow_s2s"); + }; + if not host_config.core.component_module then -- host + host_session.type = "local"; + host_session.sessions = {}; + if configmanager.get(host, "core", "anonymous_login") then + host_session.disallow_s2s = (configmanager.get(host, "core", "disallow_s2s") ~= false); + end + else -- component + host_session.type = "component"; + end + hosts[host] = host_session; for option_name in pairs(host_config.core) do if option_name:match("_ports$") or option_name:match("_interface$") then log("warn", "%s: Option '%s' has no effect for virtual hosts - put it in the server-wide section instead", host, option_name);