From b5aad7039cfc5bc08502a5d9228336c034a0c23c Mon Sep 17 00:00:00 2001 From: Nikos Kouremenos Date: Mon, 12 Sep 2005 10:54:10 +0000 Subject: [PATCH] adhere to jep about kicked by None/banned by None --- src/groupchat_window.py | 26 ++++++++++++++++++-------- 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/groupchat_window.py b/src/groupchat_window.py index d2f390043..3a01abdb7 100644 --- a/src/groupchat_window.py +++ b/src/groupchat_window.py @@ -334,19 +334,29 @@ class GroupchatWindow(chat.Chat): model = self.list_treeview[room_jid].get_model() if show in ('offline', 'error'): if statusCode == '307': - s = _('%(nick)s has been kicked by %(who)s: %(reason)s') % { - 'nick': nick, - 'who': actor, - 'reason': reason } + if actor is None: # do not print 'kicked by None' + s = _('%(nick)s has been kicked: %(reason)s') % { + 'nick': nick, + 'reason': reason } + else: + s = _('%(nick)s has been kicked by %(who)s: %(reason)s') % { + 'nick': nick, + 'who': actor, + 'reason': reason } self.print_conversation(s, room_jid) #FIXME: this produced foo has been kicked by JID: reason # Should we show the JID to everyone? the same for ban # I propose we use nick elif statusCode == '301': - s = _('%(nick)s has been banned by %(who)s: %(reason)s') % { - 'nick': nick, - 'who': actor, - 'reason': reason } + if actor is None: # do not print 'banned by None' + s = _('%(nick)s has been banned: %(reason)s') % { + 'nick': nick, + 'reason': reason } + else: + s = _('%(nick)s has been banned by %(who)s: %(reason)s') % { + 'nick': nick, + 'who': actor, + 'reason': reason } self.print_conversation(s, room_jid) elif statusCode == '303': # Someone changed his nick if nick == self.nicks[room_jid]: # We changed our nick