Changeset

5382:214c32e10734

mod_privacy: Drop stanzas of type groupchat, so users aren't kicked from their chatrooms when blocking specific MUC occupants.
author Tobias Markmann <tm@ayena.de>
date Thu, 28 Mar 2013 12:49:19 +0100
parents 5381:30484214d49b
children 5394:3d1de30fefec
files plugins/mod_privacy.lua
diffstat 1 files changed, 4 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/plugins/mod_privacy.lua	Sat Mar 23 04:17:39 2013 +0100
+++ b/plugins/mod_privacy.lua	Thu Mar 28 12:49:19 2013 +0100
@@ -366,6 +366,10 @@
 		end
 		if apply then
 			if block then
+				-- drop and not bounce groupchat messages, otherwise users will get kicked
+				if stanza.attr.type == "groupchat" then
+					return true;
+				end
 				module:log("debug", "stanza blocked: %s, to: %s, from: %s", tostring(stanza.name), tostring(to), tostring(from));
 				if stanza.name == "message" then
 					origin.send(st.error_reply(stanza, "cancel", "service-unavailable"));