From 896fa313d290549db43a75dd7ab0dd2b49d0aef9 Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Tue, 5 Oct 2010 00:19:48 +0000 Subject: fix a crash on a kick with no reason. Also little cleanup --- src/gui.py | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src') diff --git a/src/gui.py b/src/gui.py index 574368d1..0be0b6ad 100644 --- a/src/gui.py +++ b/src/gui.py @@ -318,7 +318,7 @@ class Gui(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 '' + reason = reason.text if reason else '' if from_nick == room.own_nick: # we are kicked room.disconnect() if by: @@ -883,8 +883,6 @@ class Gui(object): args = shlex.split(arg) except ValueError as error: return self.information(str(error), _("Error")) - # TODO information message - # return self.add_message_to_text_buffer(self.current_room(), _("Error: %s") % (error)) if len(args) < 1: self.command_help('kick') return @@ -900,20 +898,6 @@ class Gui(object): if res['type'] == 'error': self.room_error(res, roomname) - # def command_say(self, arg): - # """ - # /say - # """ - # line = arg - # if self.current_room().name != 'Info': - # if self.current_room().jid is not None: - # muc.send_private_message(self.xmpp, self.current_room().name, line) - # self.add_message_to_text_buffer(self.current_room(), line, None, self.current_room().own_nick) - # else: - # muc.send_groupchat_message(self.xmpp, self.current_room().name, line) - # self.window.input.refresh() - # doupdate() - def command_join(self, arg): """ /join [room][/nick] [password] -- cgit v1.2.3