X-Git-Url: https://git.enpas.org/?a=blobdiff_plain;f=core%2Fhostmanager.lua;h=53c1cd4eeaa4cd72b54507952ad1401738f60553;hb=a14deb1f4521c0dd3a1e062c521ba71c54bafc75;hp=046722b1a0ff3ca80c40f4a5225e06354ba6e566;hpb=eb667887d3e88dca83c75c485654e9e74e60d5ee;p=prosody.git diff --git a/core/hostmanager.lua b/core/hostmanager.lua index 046722b1..53c1cd4e 100644 --- a/core/hostmanager.lua +++ b/core/hostmanager.lua @@ -28,7 +28,7 @@ local pairs, select, rawget = pairs, select, rawget; local tostring, type = tostring, type; local setmetatable = setmetatable; -module "hostmanager" +local _ENV = nil; local host_mt = { } function host_mt:__tostring() @@ -45,6 +45,8 @@ end local hosts_loaded_once; +local activate, deactivate; + local function load_enabled_hosts(config) local defined_hosts = config or configmanager.getconfig(); local activated_any_host; @@ -164,8 +166,12 @@ function deactivate(host, reason) return true; end -function get_children(host) +local function get_children(host) return disco_items:get(host) or NULL; end -return _M; +return { + activate = activate; + deactivate = deactivate; + get_children = get_children; +}