mod_privacy: Drop stanzas of type groupchat, so users aren't kicked from their chatro...
authorTobias Markmann <tm@ayena.de>
Thu, 28 Mar 2013 11:49:19 +0000 (12:49 +0100)
committerTobias Markmann <tm@ayena.de>
Thu, 28 Mar 2013 11:49:19 +0000 (12:49 +0100)
plugins/mod_privacy.lua

index 7ec94922ad562170f1f118393f3524a5e15f9c66..dc6b153a46caff8cd41916ce84a26020d2f42653 100644 (file)
@@ -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"));