diff options
author | Matthew Wild <mwild1@gmail.com> | 2015-05-19 09:31:12 +0100 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2015-05-19 09:31:12 +0100 |
commit | 527e1e4bad2c8536f9c0b905e77d2679ca9ae9d5 (patch) | |
tree | 6225faf7bc524edf57e2118bc8633e07d2b28333 /core/hostmanager.lua | |
parent | a1eac64a926aeeec8babac775aa689dab4a598d3 (diff) | |
parent | bb08d35ca72865e4ba3432a30a6df7e4d9e77c62 (diff) | |
download | prosody-527e1e4bad2c8536f9c0b905e77d2679ca9ae9d5.tar.gz prosody-527e1e4bad2c8536f9c0b905e77d2679ca9ae9d5.zip |
Merge 0.10->trunk
Diffstat (limited to 'core/hostmanager.lua')
-rw-r--r-- | core/hostmanager.lua | 15 |
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 = {}; |