# HG changeset patch # User Florian Zeitz # Date 1339201664 -7200 # Node ID dcc8e789df3638d7532b30b89c58a02a07171c1f # Parent 776a57ca0d84edc9d5af67dcfbb90139dbe903ba mod_admin_telnet, prosody, prosodyctl, ejabberd2prosody: Don't depend on modules setting globals diff -r 776a57ca0d84 -r dcc8e789df36 plugins/mod_admin_telnet.lua --- a/plugins/mod_admin_telnet.lua Sat Jun 09 01:18:21 2012 +0200 +++ b/plugins/mod_admin_telnet.lua Sat Jun 09 02:27:44 2012 +0200 @@ -15,6 +15,9 @@ local console_listener = { default_port = 5582; default_mode = "*l"; interface = "127.0.0.1" }; +local hostmanager = require "core.hostmanager"; +local modulemanager = require "core.modulemanager"; + local iterators = require "util.iterators"; local keys, values = iterators.keys, iterators.values; local jid = require "util.jid"; diff -r 776a57ca0d84 -r dcc8e789df36 prosody --- a/prosody Sat Jun 09 01:18:21 2012 +0200 +++ b/prosody Sat Jun 09 02:27:44 2012 +0200 @@ -128,7 +128,7 @@ end function sanity_check() - for host, host_config in pairs(configmanager.getconfig()) do + for host, host_config in pairs(config.getconfig()) do if host ~= "*" and host_config.core.enabled ~= false and not host_config.core.component_module then diff -r 776a57ca0d84 -r dcc8e789df36 prosodyctl --- a/prosodyctl Sat Jun 09 01:18:21 2012 +0200 +++ b/prosodyctl Sat Jun 09 02:27:44 2012 +0200 @@ -227,9 +227,9 @@ hosts[hostname] = make_host(hostname); end -require "core.modulemanager" +local modulemanager = require "core.modulemanager" -require "util.prosodyctl" +local prosodyctl = require "util.prosodyctl" require "socket" ----------------------- @@ -509,7 +509,7 @@ return 1; end - require "util.array"; + local array = require "util.array"; local keys = require "util.iterators".keys; print("Prosody "..(prosody.version or "(unknown version)")); diff -r 776a57ca0d84 -r dcc8e789df36 tools/ejabberd2prosody.lua --- a/tools/ejabberd2prosody.lua Sat Jun 09 01:18:21 2012 +0200 +++ b/tools/ejabberd2prosody.lua Sat Jun 09 02:27:44 2012 +0200 @@ -15,7 +15,7 @@ package.path = package.path .. ";"..arg[0]:gsub("/ejabberd2prosody.lua$", "/?.lua"); end -require "erlparse"; +local erlparse = require "erlparse"; prosody = {}; diff -r 776a57ca0d84 -r dcc8e789df36 util/prosodyctl.lua --- a/util/prosodyctl.lua Sat Jun 09 01:18:21 2012 +0200 +++ b/util/prosodyctl.lua Sat Jun 09 02:27:44 2012 +0200 @@ -273,3 +273,5 @@ signal.kill(pid, signal.SIGHUP); return true; end + +return _M;