aboutsummaryrefslogtreecommitdiffstats
path: root/core/hostmanager.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2015-05-19 16:33:47 +0200
committerKim Alvefur <zash@zash.se>2015-05-19 16:33:47 +0200
commit98d695f3a199cdf07d26f9c0ae7d23a56da157a1 (patch)
tree14a722959d1179338adec58efd9e5d7fcfa58ada /core/hostmanager.lua
parent879862c536a5fba488307eb9e8a2f4f6523dbf09 (diff)
parent9ef666506252bd82ae729d0a69235f4c9ea818f2 (diff)
downloadprosody-98d695f3a199cdf07d26f9c0ae7d23a56da157a1.tar.gz
prosody-98d695f3a199cdf07d26f9c0ae7d23a56da157a1.zip
Merge 0.10->trunk
Diffstat (limited to 'core/hostmanager.lua')
-rw-r--r--core/hostmanager.lua15
1 files changed, 15 insertions, 0 deletions
diff --git a/core/hostmanager.lua b/core/hostmanager.lua
index b13b1944..3d581418 100644
--- a/core/hostmanager.lua
+++ b/core/hostmanager.lua
@@ -26,9 +26,23 @@ local core_route_stanza = _G.prosody.core_route_stanza;
local pairs, select, rawget = pairs, select, rawget;
local tostring, type = tostring, type;
+local setmetatable = setmetatable;
module "hostmanager"
+local host_mt = { }
+function host_mt:__tostring()
+ if self.type == "component" then
+ local typ = configmanager.get(self.host, "component_module");
+ if typ == "component" then
+ return ("Component %q"):format(self.host);
+ end
+ return ("Component %q %q"):format(self.host, typ);
+ elseif self.type == "local" then
+ return ("VirtualHost %q"):format(self.host);
+ end
+end
+
local hosts_loaded_once;
local function load_enabled_hosts(config)
@@ -69,6 +83,7 @@ function activate(host, host_config)
send = host_send;
modules = {};
};
+ setmetatable(host_session, host_mt);
if not host_config.component_module then -- host
host_session.type = "local";
host_session.sessions = {};