# HG changeset patch # User Matthew Wild # Date 1264776037 0 # Node ID 3365ed0ed5bdcf12f7ed52706f4b15f8135303fc # Parent 3fe3dbb27b6f3e206eea6ac016dde3526cb69833 MUC: Show error message texts when participants are kicked for stanza errors diff -r 3fe3dbb27b6f -r 3365ed0ed5bd plugins/muc/muc.lib.lua --- a/plugins/muc/muc.lib.lua Fri Jan 29 14:26:54 2010 +0000 +++ b/plugins/muc/muc.lib.lua Fri Jan 29 14:40:37 2010 +0000 @@ -200,9 +200,14 @@ 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