aboutsummaryrefslogtreecommitdiffstats
path: root/plugins
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2013-04-03 13:53:21 +0100
committerMatthew Wild <mwild1@gmail.com>2013-04-03 13:53:21 +0100
commit1213909d149d2ae2d697d6694ee1a30ef41c47f4 (patch)
treebf22e9f39d9ccaa98ba9f214cfa01d7c3408d46a /plugins
parentc8e37d89fdf5c9b5990cd309d53707f990986559 (diff)
parent64579702abbbb36676a94a86d88cc54c119f4433 (diff)
downloadprosody-1213909d149d2ae2d697d6694ee1a30ef41c47f4.tar.gz
prosody-1213909d149d2ae2d697d6694ee1a30ef41c47f4.zip
Merge 0.9->trunk
Diffstat (limited to 'plugins')
-rw-r--r--plugins/mod_groups.lua7
-rw-r--r--plugins/mod_presence.lua4
-rw-r--r--plugins/mod_pubsub.lua10
-rw-r--r--plugins/mod_s2s/mod_s2s.lua6
4 files changed, 13 insertions, 14 deletions
diff --git a/plugins/mod_groups.lua b/plugins/mod_groups.lua
index 199925f9..f7f632c2 100644
--- a/plugins/mod_groups.lua
+++ b/plugins/mod_groups.lua
@@ -13,7 +13,7 @@ local members;
local groups_file;
local jid, datamanager = require "util.jid", require "util.datamanager";
-local jid_bare, jid_prep = jid.bare, jid.prep;
+local jid_prep = jid.prep;
local module_host = module:get_host();
@@ -121,3 +121,8 @@ end
function module.unload()
datamanager.remove_callback(remove_virtual_contacts);
end
+
+-- Public for other modules to access
+function group_contains(group_name, jid)
+ return groups[group_name][jid];
+end
diff --git a/plugins/mod_presence.lua b/plugins/mod_presence.lua
index b6e3fc18..8dac2d35 100644
--- a/plugins/mod_presence.lua
+++ b/plugins/mod_presence.lua
@@ -9,7 +9,7 @@
local log = module._log;
local require = require;
-local pairs, ipairs = pairs, ipairs;
+local pairs = pairs;
local t_concat, t_insert = table.concat, table.insert;
local s_find = string.find;
local tonumber = tonumber;
@@ -346,7 +346,7 @@ module:hook("presence/full", function(data)
end);
module:hook("presence/host", function(data)
-- inbound presence to the host
- local origin, stanza = data.origin, data.stanza;
+ local stanza = data.stanza;
local from_bare = jid_bare(stanza.attr.from);
local t = stanza.attr.type;
diff --git a/plugins/mod_pubsub.lua b/plugins/mod_pubsub.lua
index fe6c0b0a..5ff3a029 100644
--- a/plugins/mod_pubsub.lua
+++ b/plugins/mod_pubsub.lua
@@ -164,16 +164,6 @@ function handlers.set_subscribe(origin, stanza, subscribe)
reply = pubsub_error_reply(stanza, ret);
end
origin.send(reply);
- if ok then
- -- Send all current items
- local ok, items = service:get_items(node, stanza.attr.from);
- if items then
- local jids = { [jid] = options or true };
- for id, item in pairs(items) do
- service.config.broadcaster("items", node, jids, item);
- end
- end
- end
end
function handlers.set_unsubscribe(origin, stanza, unsubscribe)
diff --git a/plugins/mod_s2s/mod_s2s.lua b/plugins/mod_s2s/mod_s2s.lua
index 6893d184..639f464b 100644
--- a/plugins/mod_s2s/mod_s2s.lua
+++ b/plugins/mod_s2s/mod_s2s.lua
@@ -632,7 +632,11 @@ function check_auth_policy(event)
if must_secure and not session.cert_identity_status then
module:log("warn", "Forbidding insecure connection to/from %s", host);
- session:close(false);
+ if session.direction == "incoming" then
+ session:close({ condition = "not-authorized", text = "Your server's certificate is invalid, expired, or not trusted by"..session.to_host });
+ else -- Close outgoing connections without warning
+ session:close(false);
+ end
return false;
end
end