From 71a08805224b3693573fade6b1f2c1f6d71bef6d Mon Sep 17 00:00:00 2001 From: Matthew Wild Date: Fri, 29 Jan 2010 14:40:37 +0000 Subject: MUC: Show error message texts when participants are kicked for stanza errors --- plugins/muc/muc.lib.lua | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) (limited to 'plugins') 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 -- cgit v1.2.3