mod_announce, mod_auth_anonymous, mod_c2s, mod_c2s, mod_component, mod_iq, mod_message, mod_presence, mod_tls: Access prosody.{hosts,bare_sessions,full_sessions} instead of the old globals

This commit is contained in:
Kim Alvefur 2013-03-23 01:27:16 +01:00
parent 68a7de369b
commit 27dc3a5b9a
9 changed files with 12 additions and 7 deletions

View file

@ -8,6 +8,7 @@
local st, jid = require "util.stanza", require "util.jid";
local hosts = prosody.hosts;
local is_admin = require "core.usermanager".is_admin;
function send_to_online(message, host)

View file

@ -8,6 +8,7 @@
local new_sasl = require "util.sasl".new;
local datamanager = require "util.datamanager";
local hosts = prosody.hosts;
-- define auth provider
local provider = {};

View file

@ -29,6 +29,7 @@ local opt_keepalives = module:get_option_boolean("tcp_keepalives", false);
local sessions = module:shared("sessions");
local core_process_stanza = prosody.core_process_stanza;
local hosts = prosody.hosts;
local stream_callbacks = { default_ns = "jabber:client", handlestanza = core_process_stanza };
local listener = {};

View file

@ -19,7 +19,7 @@ local new_xmpp_stream = require "util.xmppstream".new;
local uuid_gen = require "util.uuid".generate;
local core_process_stanza = prosody.core_process_stanza;
local hosts = prosody.hosts;
local log = module._log;

View file

@ -9,7 +9,7 @@
local st = require "util.stanza";
local full_sessions = full_sessions;
local full_sessions = prosody.full_sessions;
if module:get_host_type() == "local" then
module:hook("iq/full", function(data)

View file

@ -7,8 +7,8 @@
--
local full_sessions = full_sessions;
local bare_sessions = bare_sessions;
local full_sessions = prosody.full_sessions;
local bare_sessions = prosody.bare_sessions;
local st = require "util.stanza";
local jid_bare = require "util.jid".bare;

View file

@ -19,7 +19,9 @@ local st = require "util.stanza";
local jid_split = require "util.jid".split;
local jid_bare = require "util.jid".bare;
local datetime = require "util.datetime";
local hosts = hosts;
local hosts = prosody.hosts;
local bare_sessions = prosody.bare_sessions;
local full_sessions = prosody.full_sessions;
local NULL = {};
local rostermanager = require "core.rostermanager";

View file

@ -9,10 +9,9 @@
module:add_feature("jabber:iq:privacy");
local prosody = prosody;
local st = require "util.stanza";
local datamanager = require "util.datamanager";
local bare_sessions, full_sessions = bare_sessions, full_sessions;
local bare_sessions, full_sessions = prosody.bare_sessions, prosody.full_sessions;
local util_Jid = require "util.jid";
local jid_bare = util_Jid.bare;
local jid_split, jid_join = util_Jid.split, util_Jid.join;

View file

@ -25,6 +25,7 @@ if secure_s2s_only then s2s_feature:tag("required"):up(); end
local global_ssl_ctx = prosody.global_ssl_ctx;
local hosts = prosody.hosts;
local host = hosts[module.host];
local function can_do_tls(session)