From 190fc0a1f75cb763fcefcf6cc0c0d59ffc7d0b2e Mon Sep 17 00:00:00 2001 From: "louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13" Date: Tue, 7 Dec 2010 19:37:30 +0000 Subject: fix 'j' on MucListTab when row number 0 is selected --- src/room.py | 2 -- src/tabs.py | 6 ++++-- src/windows.py | 2 +- 3 files changed, 5 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/room.py b/src/room.py index 74203a36..62ece926 100644 --- a/src/room.py +++ b/src/room.py @@ -111,8 +111,6 @@ class Room(TextBuffer): self.color_state != theme.COLOR_TAB_CURRENT: if self.color_state != theme.COLOR_TAB_HIGHLIGHT: self.set_color_state(theme.COLOR_TAB_NEW_MESSAGE) - # elif self.jid: - # self.set_color_state(theme.COLOR_TAB_PRIVATE) if not nickname: color = theme.COLOR_INFORMATION_TEXT else: diff --git a/src/tabs.py b/src/tabs.py index 2dc6a017..bacef726 100644 --- a/src/tabs.py +++ b/src/tabs.py @@ -989,8 +989,10 @@ class MucListTab(Tab): return def join_selected(self): - jid = self.listview.get_selected_row()['jid'] - self.core.command_join(jid) + row = self.listview.get_selected_row() + if not row: + return + self.core.command_join(row['jid']) def reset_help_message(self, _=None): curses.curs_set(0) diff --git a/src/windows.py b/src/windows.py index 28748a73..81f81f60 100644 --- a/src/windows.py +++ b/src/windows.py @@ -1307,7 +1307,7 @@ class ListWin(Win): """ Return the tuple representing the selected row """ - if self._selected_row: + if self._selected_row is not None: return self.lines[self._selected_row] return None -- cgit v1.2.3