aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_blocklist.lua
diff options
context:
space:
mode:
authorKim Alvefur <zash@zash.se>2017-09-29 13:45:03 +0200
committerKim Alvefur <zash@zash.se>2017-09-29 13:45:03 +0200
commitca622317f100d67023e2088179011eb61a243a2d (patch)
treecd04cb8a03e077a91511ed8d509a4e2e83588628 /plugins/mod_blocklist.lua
parentdb450adf9e7f6dbb96cddb15a8b929f367435981 (diff)
parent37d1497aedaf666ed0a1c4d5eeb47c54b1efd98c (diff)
downloadprosody-ca622317f100d67023e2088179011eb61a243a2d.tar.gz
prosody-ca622317f100d67023e2088179011eb61a243a2d.zip
Merge 0.10->trunk
Diffstat (limited to 'plugins/mod_blocklist.lua')
-rw-r--r--plugins/mod_blocklist.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/mod_blocklist.lua b/plugins/mod_blocklist.lua
index ae24a2fc..e10ac27d 100644
--- a/plugins/mod_blocklist.lua
+++ b/plugins/mod_blocklist.lua
@@ -22,6 +22,7 @@ local jid_split = require"util.jid".split;
local storage = module:open_store();
local sessions = prosody.hosts[module.host].sessions;
+local full_sessions = prosody.full_sessions;
-- First level cache of blocklists by username.
-- Weak table so may randomly expire at any time.
@@ -271,8 +272,13 @@ local function bounce_iq(event)
end
local function bounce_message(event)
- local type = event.stanza.attr.type;
+ local stanza = event.stanza;
+ local type = stanza.attr.type;
if type == "chat" or not type or type == "normal" then
+ if full_sessions[stanza.attr.to] then
+ -- See #690
+ return drop_stanza(event);
+ end
return bounce_stanza(event);
end
return drop_stanza(event); -- drop headlines, groupchats etc
@@ -305,7 +311,6 @@ local prio_in, prio_out = 100, 100;
module:hook("presence/bare", drop_stanza, prio_in);
module:hook("presence/full", drop_stanza, prio_in);
--- FIXME See #690
module:hook("message/bare", bounce_message, prio_in);
module:hook("message/full", bounce_message, prio_in);