summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-01-13 22:02:35 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-01-13 22:02:35 +0100
commitc94be4761a3182b212cf0d507974e200e8e020e8 (patch)
treea686e6ce505c6cb1f8187fc93d41cd98b9d23f5c
parent7994507bc3321172a369d5881f2b579a122a3c29 (diff)
downloadpoezio-c94be4761a3182b212cf0d507974e200e8e020e8.tar.gz
poezio-c94be4761a3182b212cf0d507974e200e8e020e8.tar.bz2
poezio-c94be4761a3182b212cf0d507974e200e8e020e8.tar.xz
poezio-c94be4761a3182b212cf0d507974e200e8e020e8.zip
Restaure the display of the kick's reason if available
-rw-r--r--src/core.py5
1 files 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):