aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorMatthew Wild <mwild1@gmail.com>2010-01-29 14:40:37 +0000
committerMatthew Wild <mwild1@gmail.com>2010-01-29 14:40:37 +0000
commit71a08805224b3693573fade6b1f2c1f6d71bef6d (patch)
tree47971db31a477a4c73acfcef2860a10d2e8a06d4
parent119072d7d8a3a5e2c60229786eb746a8e1d04670 (diff)
downloadprosody-71a08805224b3693573fade6b1f2c1f6d71bef6d.tar.gz
prosody-71a08805224b3693573fade6b1f2c1f6d71bef6d.zip
MUC: Show error message texts when participants are kicked for stanza errors
-rw-r--r--plugins/muc/muc.lib.lua9
1 files changed, 7 insertions, 2 deletions
diff --git a/plugins/muc/muc.lib.lua b/plugins/muc/muc.lib.lua
index 896a977f..103227f0 100644
--- a/plugins/muc/muc.lib.lua
+++ b/plugins/muc/muc.lib.lua
@@ -200,9 +200,14 @@ function room_mt:handle_to_occupant(origin, stanza) -- PM, vCards, etc
pr.attr.from = current_nick;
if type == "error" then -- error, kick em out!
if current_nick then
- log("debug", "kicking %s from %s", current_nick, room);
+ local type, condition, text = stanza:get_error();
+ local error_message = "Kicked: "..condition:gsub("%-", " ");
+ if text then
+ error_message = error_message..": "..text;
+ end
+ log("debug", "kicking %s from %s for %s", current_nick, room, condition);
self:handle_to_occupant(origin, st.presence({type='unavailable', from=from, to=to})
- :tag('status'):text('Kicked: '..get_error_condition(stanza))); -- send unavailable
+ :tag('status'):text(error_message)); -- send unavailable
end
elseif type == "unavailable" then -- unavailable
if current_nick then