aboutsummaryrefslogtreecommitdiffstats
path: root/plugins/muc/muc.lib.lua
diff options
context:
space:
mode:
authorWaqas Hussain <waqas20@gmail.com>2009-10-18 05:35:33 +0500
committerWaqas Hussain <waqas20@gmail.com>2009-10-18 05:35:33 +0500
commit6efc411a5c6586f09a9bbceaaa4f68c21da55bdb (patch)
treeddd6b22f7dbc40e03fcc8dc169336385aaf2df11 /plugins/muc/muc.lib.lua
parentb211bef403270b251ec03ad08c88793c18c187ad (diff)
downloadprosody-6efc411a5c6586f09a9bbceaaa4f68c21da55bdb.tar.gz
prosody-6efc411a5c6586f09a9bbceaaa4f68c21da55bdb.zip
MUC: Kick occupants on sending error messages to other occupants.
Diffstat (limited to 'plugins/muc/muc.lib.lua')
-rw-r--r--plugins/muc/muc.lib.lua4
1 files changed, 4 insertions, 0 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 7a8e3c8c..0fb91b53 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -351,6 +351,10 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
end
elseif stanza.name == "message" and type == "groupchat" then -- groupchat messages not allowed in PM
origin.send(st.error_reply(stanza, "modify", "bad-request"));
+ elseif current_nick and stanza.name == "message" and type == "error" and get_kickable_error(stanza) then
+ log("debug", "%s kicked from %s for sending an error message", current_nick, self.jid);
+ self:handle_to_occupant(origin, st.presence({type='unavailable', from=stanza.attr.from, to=stanza.attr.to})
+ :tag('status'):text('This participant is kicked from the room because he sent an error message to another occupant')); -- send unavailable
else -- private stanza
local o_data = self._occupants[to];
if o_data then