Diff

plugins/mod_blocklist.lua @ 8285:433b2a41351f

Merge 0.10->trunk
author Kim Alvefur <zash@zash.se>
date Fri, 29 Sep 2017 13:45:03 +0200
parent 8275:13dad833e821
child 8741:0fd63ed1f647
line wrap: on
line diff
--- a/plugins/mod_blocklist.lua	Fri Sep 29 10:50:27 2017 +0200
+++ b/plugins/mod_blocklist.lua	Fri Sep 29 13:45:03 2017 +0200
@@ -22,6 +22,7 @@
 
 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 @@
 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 @@
 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);