X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fhostmanager.lua;h=97c742da5f133df86007bcb7d9fcabe2ff1a5de4;hb=34215744d79b2fcf146b69a59007d104085dff4a;hp=64bb13f70d658b0866f1d5c883e7a41d8e6a0443;hpb=06edec9c84a201fc7235ee77b2629850da560f39;p=prosody.git diff --git a/core/hostmanager.lua b/core/hostmanager.lua index 64bb13f7..97c742da 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -9,6 +9,8 @@ local pairs = pairs; module "hostmanager" +local hosts_loaded_once; + local function load_enabled_hosts(config) local defined_hosts = config or configmanager.getconfig(); @@ -17,13 +19,15 @@ local function load_enabled_hosts(config) activate(host, host_config); end end + eventmanager.fire_event("hosts-activated", defined_hosts); + hosts_loaded_once = true; end eventmanager.add_event_hook("server-starting", load_enabled_hosts); function activate(host, host_config) hosts[host] = {type = "local", connected = true, sessions = {}, host = host, s2sout = {} }; - log("info", "Activated host: %s", host); + log((hosts_loaded_once and "info") or "debug", "Activated host: %s", host); eventmanager.fire_event("host-activated", host, host_config); end