aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2013-03-23 04:17:39 +0100
committerKim Alvefur <zash@zash.se>2013-03-23 04:17:39 +0100
commit983891c9fa8e728aa4680aedc74ec50a0329346e (patch)
treefc52870bbca26966e739b1654dd7ff728fbbd9e0 /plugins
parent4adcfb2d185bb95ec430822c772f091b713faa7a (diff)
parent869da6c240dccfed8c43228ceb989af5faf6c8f1 (diff)
downloadprosody-983891c9fa8e728aa4680aedc74ec50a0329346e.tar.gz
prosody-983891c9fa8e728aa4680aedc74ec50a0329346e.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_admin_adhoc.lua6
-rw-r--r--plugins/mod_announce.lua1
-rw-r--r--plugins/mod_auth_anonymous.lua1
-rw-r--r--plugins/mod_c2s.lua1
-rw-r--r--plugins/mod_component.lua2
-rw-r--r--plugins/mod_groups.lua2
-rw-r--r--plugins/mod_http.lua1
-rw-r--r--plugins/mod_http_errors.lua1
-rw-r--r--plugins/mod_iq.lua2
-rw-r--r--plugins/mod_message.lua4
-rw-r--r--plugins/mod_motd.lua1
-rw-r--r--plugins/mod_presence.lua4
-rw-r--r--plugins/mod_privacy.lua3
-rw-r--r--plugins/mod_private.lua1
-rw-r--r--plugins/mod_proxy65.lua2
-rw-r--r--plugins/mod_register.lua1
-rw-r--r--plugins/mod_roster.lua1
-rw-r--r--plugins/mod_tls.lua5
-rw-r--r--plugins/muc/mod_muc.lua2
19 files changed, 20 insertions, 21 deletions
diff --git a/plugins/mod_admin_adhoc.lua b/plugins/mod_admin_adhoc.lua
index f136eb46..ff672fc9 100644
--- a/plugins/mod_admin_adhoc.lua
+++ b/plugins/mod_admin_adhoc.lua
@@ -10,8 +10,7 @@ local prosody = _G.prosody;
local hosts = prosody.hosts;
local t_concat = table.concat;
-local iterators = require "util.iterators";
-local keys, values = iterators.keys, iterators.values;
+local keys = require "util.iterators".keys;
local usermanager_user_exists = require "core.usermanager".user_exists;
local usermanager_create_user = require "core.usermanager".create_user;
local usermanager_delete_user = require "core.usermanager".delete_user;
@@ -19,9 +18,8 @@ local usermanager_get_password = require "core.usermanager".get_password;
local usermanager_set_password = require "core.usermanager".set_password;
local hostmanager_activate = require "core.hostmanager".activate;
local hostmanager_deactivate = require "core.hostmanager".deactivate;
-local is_admin = require "core.usermanager".is_admin;
local rm_load_roster = require "core.rostermanager".load_roster;
-local st, jid, uuid = require "util.stanza", require "util.jid", require "util.uuid";
+local st, jid = require "util.stanza", require "util.jid";
local timer_add_task = require "util.timer".add_task;
local dataforms_new = require "util.dataforms".new;
local array = require "util.array";
diff --git a/plugins/mod_announce.lua b/plugins/mod_announce.lua
index 0872bd21..96976d6f 100644
--- a/plugins/mod_announce.lua
+++ b/plugins/mod_announce.lua
@@ -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)
diff --git a/plugins/mod_auth_anonymous.lua b/plugins/mod_auth_anonymous.lua
index a327f438..c877d532 100644
--- a/plugins/mod_auth_anonymous.lua
+++ b/plugins/mod_auth_anonymous.lua
@@ -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 = {};
diff --git a/plugins/mod_c2s.lua b/plugins/mod_c2s.lua
index 89d678ca..4a3197d9 100644
--- a/plugins/mod_c2s.lua
+++ b/plugins/mod_c2s.lua
@@ -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 = {};
diff --git a/plugins/mod_component.lua b/plugins/mod_component.lua
index 68d8a5de..871a20e4 100644
--- a/plugins/mod_component.lua
+++ b/plugins/mod_component.lua
@@ -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;
diff --git a/plugins/mod_groups.lua b/plugins/mod_groups.lua
index 7a876f1d..199925f9 100644
--- a/plugins/mod_groups.lua
+++ b/plugins/mod_groups.lua
@@ -80,7 +80,7 @@ function remove_virtual_contacts(username, host, datastore, data)
end
function module.load()
- groups_file = config.get(module:get_host(), "core", "groups_file");
+ groups_file = module:get_option_string("groups_file");
if not groups_file then return; end
module:hook("roster-load", inject_roster_contacts);
diff --git a/plugins/mod_http.lua b/plugins/mod_http.lua
index c5381577..2fa87421 100644
--- a/plugins/mod_http.lua
+++ b/plugins/mod_http.lua
@@ -9,6 +9,7 @@
module:set_global();
module:depends("http_errors");
+local portmanager = require "core.portmanager";
local moduleapi = require "core.moduleapi";
local url_parse = require "socket.url".parse;
local url_build = require "socket.url".build;
diff --git a/plugins/mod_http_errors.lua b/plugins/mod_http_errors.lua
index 828216dd..2568ea80 100644
--- a/plugins/mod_http_errors.lua
+++ b/plugins/mod_http_errors.lua
@@ -2,7 +2,6 @@ module:set_global();
local server = require "net.http.server";
local codes = require "net.http.codes";
-local termcolours = require "util.termcolours";
local show_private = module:get_option_boolean("http_errors_detailed", false);
local always_serve = module:get_option_boolean("http_errors_always_show", true);
diff --git a/plugins/mod_iq.lua b/plugins/mod_iq.lua
index 8044a533..e7901ab4 100644
--- a/plugins/mod_iq.lua
+++ b/plugins/mod_iq.lua
@@ -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)
diff --git a/plugins/mod_message.lua b/plugins/mod_message.lua
index 0b0ad8e4..e85da613 100644
--- a/plugins/mod_message.lua
+++ b/plugins/mod_message.lua
@@ -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;
diff --git a/plugins/mod_motd.lua b/plugins/mod_motd.lua
index fea2cb85..ed78294b 100644
--- a/plugins/mod_motd.lua
+++ b/plugins/mod_motd.lua
@@ -13,7 +13,6 @@ local motd_jid = module:get_option_string("motd_jid", host);
if not motd_text then return; end
-local jid_join = require "util.jid".join;
local st = require "util.stanza";
motd_text = motd_text:gsub("^%s*(.-)%s*$", "%1"):gsub("\n%s+", "\n"); -- Strip indentation from the config
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index 23012750..b6e3fc18 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -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";
diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua
index 2d696154..7ec94922 100644
--- a/plugins/mod_privacy.lua
+++ b/plugins/mod_privacy.lua
@@ -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;
diff --git a/plugins/mod_private.lua b/plugins/mod_private.lua
index f1ebe786..29d3162c 100644
--- a/plugins/mod_private.lua
+++ b/plugins/mod_private.lua
@@ -9,7 +9,6 @@
local st = require "util.stanza"
-local jid_split = require "util.jid".split;
local datamanager = require "util.datamanager"
module:add_feature("jabber:iq:private");
diff --git a/plugins/mod_proxy65.lua b/plugins/mod_proxy65.lua
index 0d05b2ac..1fa42bd8 100644
--- a/plugins/mod_proxy65.lua
+++ b/plugins/mod_proxy65.lua
@@ -95,7 +95,7 @@ function module.add_host(module)
local proxy_port = next(portmanager.get_active_services():search("proxy65", nil)[1] or {});
local proxy_acl = module:get_option("proxy65_acl");
- -- COMPAT w/pre-0.9 where proxy65_port was specified the components section of the config
+ -- COMPAT w/pre-0.9 where proxy65_port was specified in the components section of the config
local legacy_config = module:get_option_number("proxy65_port");
if legacy_config then
module:log("warn", "proxy65_port is deprecated, please put proxy65_ports = { %d } into the global section instead", legacy_config);
diff --git a/plugins/mod_register.lua b/plugins/mod_register.lua
index b3abd394..e941a128 100644
--- a/plugins/mod_register.lua
+++ b/plugins/mod_register.lua
@@ -7,7 +7,6 @@
--
-local hosts = _G.hosts;
local st = require "util.stanza";
local datamanager = require "util.datamanager";
local dataform_new = require "util.dataforms".new;
diff --git a/plugins/mod_roster.lua b/plugins/mod_roster.lua
index 40d95be7..d530bb45 100644
--- a/plugins/mod_roster.lua
+++ b/plugins/mod_roster.lua
@@ -69,7 +69,6 @@ module:hook("iq/self/jabber:iq:roster:query", function(event)
and query.tags[1].attr.jid ~= "pending" then
local item = query.tags[1];
local from_node, from_host = jid_split(stanza.attr.from);
- local from_bare = from_node and (from_node.."@"..from_host) or from_host; -- bare JID
local jid = jid_prep(item.attr.jid);
local node, host, resource = jid_split(jid);
if not resource and host then
diff --git a/plugins/mod_tls.lua b/plugins/mod_tls.lua
index 707ae8f5..80b56abb 100644
--- a/plugins/mod_tls.lua
+++ b/plugins/mod_tls.lua
@@ -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)
@@ -91,10 +92,10 @@ module:hook_stanza(xmlns_starttls, "proceed", function (session, stanza)
end);
function module.load()
- local ssl_config = config.rawget(module.host, "core", "ssl");
+ local ssl_config = config.rawget(module.host, "ssl");
if not ssl_config then
local base_host = module.host:match("%.(.*)");
- ssl_config = config.get(base_host, "core", "ssl");
+ ssl_config = config.get(base_host, "ssl");
end
host.ssl_ctx = create_context(host.host, "client", ssl_config); -- for outgoing connections
host.ssl_ctx_in = create_context(host.host, "server", ssl_config); -- for incoming connections
diff --git a/plugins/muc/mod_muc.lua b/plugins/muc/mod_muc.lua
index 9f907f17..2c2d02f7 100644
--- a/plugins/muc/mod_muc.lua
+++ b/plugins/muc/mod_muc.lua
@@ -30,7 +30,7 @@ local st = require "util.stanza";
local uuid_gen = require "util.uuid".generate;
local datamanager = require "util.datamanager";
local um_is_admin = require "core.usermanager".is_admin;
-local hosts = hosts;
+local hosts = prosody.hosts;
rooms = {};
local rooms = rooms;