diff options
author | Matthew Wild <mwild1@gmail.com> | 2018-03-22 22:35:39 +0000 |
---|---|---|
committer | Matthew Wild <mwild1@gmail.com> | 2018-03-22 22:35:39 +0000 |
commit | adc3b7267280e303d9f93e602dea051ed7fddcf5 (patch) | |
tree | 54a80202b144f0439548a7e25b4050b7fea14262 /util/startup.lua | |
parent | d93d78a56b9eee3132f23970a700f97f0c172666 (diff) | |
download | prosody-adc3b7267280e303d9f93e602dea051ed7fddcf5.tar.gz prosody-adc3b7267280e303d9f93e602dea051ed7fddcf5.zip |
util.startup: Expose make_host() function
Diffstat (limited to 'util/startup.lua')
-rw-r--r-- | util/startup.lua | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/util/startup.lua b/util/startup.lua index d8f67d4e..40c328d5 100644 --- a/util/startup.lua +++ b/util/startup.lua @@ -461,24 +461,25 @@ function startup.check_unwriteable() end end +function startup.make_host(hostname) + return { + type = "local", + events = prosody.events, + modules = {}, + sessions = {}, + users = require "core.usermanager".new_null_provider(hostname) + }; +end + function startup.make_dummy_hosts() -- When running under prosodyctl, we don't want to -- fully initialize the server, so we populate prosody.hosts -- with just enough things for most code to work correctly -- luacheck: ignore 122/hosts prosody.core_post_stanza = function () end; -- TODO: mod_router! - local function make_host(hostname) - return { - type = "local", - events = prosody.events, - modules = {}, - sessions = {}, - users = require "core.usermanager".new_null_provider(hostname) - }; - end for hostname in pairs(config.getconfig()) do - hosts[hostname] = make_host(hostname); + hosts[hostname] = startup.make_host(hostname); end end |