From c94be4761a3182b212cf0d507974e200e8e020e8 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Thu, 13 Jan 2011 22:02:35 +0100 Subject: Restaure the display of the kick's reason if available --- src/core.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/src/core.py b/src/core.py index 791394d8..a3da7e3f 100644 --- a/src/core.py +++ b/src/core.py @@ -403,7 +403,6 @@ class Core(object): by = presence.find('{http://jabber.org/protocol/muc#user}x/{http://jabber.org/protocol/muc#user}item/{http://jabber.org/protocol/muc#user}actor') reason = presence.find('{http://jabber.org/protocol/muc#user}x/{http://jabber.org/protocol/muc#user}item/{http://jabber.org/protocol/muc#user}reason') by = by.attrib['jid'] if by is not None else None - reason = reason.text if reason else '' if from_nick == room.own_nick: # we are kicked room.disconnect() if by: @@ -418,8 +417,8 @@ class Core(object): kick_msg = _('%(spec)s "[%(nick)s]" has been kicked by "[%(by)s]"') % {'spec':theme.CHAR_KICK.replace('"', '\\"'), 'nick':from_nick.replace('"', '\\"'), 'by':by.replace('"', '\\"')} else: kick_msg = _('%(spec)s "[%(nick)s]" has been kicked') % {'spec':theme.CHAR_KICK, 'nick':from_nick.replace('"', '\\"')} - if reason: - kick_msg += _(' Reason: %(reason)s') % {'reason': reason} + if reason is not None and reason.text: + kick_msg += _(' Reason: %(reason)s') % {'reason': reason.text} self.add_message_to_text_buffer(room, kick_msg, colorized=True) def on_user_leave_groupchat(self, room, user, jid, status, from_nick, from_room): -- cgit v1.2.3