Merge 0.9->0.10
[prosody.git] / core / hostmanager.lua
index 046722b1a0ff3ca80c40f4a5225e06354ba6e566..53c1cd4eeaa4cd72b54507952ad1401738f60553 100644 (file)
@@ -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;
+}