aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/mod_privacy.lua
diff options
context:
space:
mode:
authorTobias Markmann <tm@ayena.de>2013-03-28 12:49:19 +0100
committerTobias Markmann <tm@ayena.de>2013-03-28 12:49:19 +0100
commit11a3a158eb42284dd3585e04439f38ee3e6d548c (patch)
tree13397a2d6f07fbc84a3120b9594f2927a8276972 /plugins/mod_privacy.lua
parent2bde8103f5dba708e6e7a9b0773eba493bfefa7c (diff)
downloadprosody-11a3a158eb42284dd3585e04439f38ee3e6d548c.tar.gz
prosody-11a3a158eb42284dd3585e04439f38ee3e6d548c.zip
mod_privacy: Drop stanzas of type groupchat, so users aren't kicked from their chatrooms when blocking specific MUC occupants.
Diffstat (limited to 'plugins/mod_privacy.lua')
-rw-r--r--plugins/mod_privacy.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/mod_privacy.lua b/plugins/mod_privacy.lua
index 7ec94922..dc6b153a 100644
--- a/plugins/mod_privacy.lua
+++ b/plugins/mod_privacy.lua
@@ -366,6 +366,10 @@ function checkIfNeedToBeBlocked(e, session)
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"));