summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMathieu Pasquet <mathieui@mathieui.net>2013-09-19 00:19:42 +0200
committerMathieu Pasquet <mathieui@mathieui.net>2013-09-19 00:19:42 +0200
commit40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc (patch)
treedf47646aa7b7086667c4227cf254bba4dffe41ab
parentb245ff6e2da5eb56e9233ff5bac1d4855e64e949 (diff)
downloadpoezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.gz
poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.bz2
poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.tar.xz
poezio-40af34ad7cf44da77a1d9ed8f63bee5d6790e8cc.zip
Fix #2372 (traceback on space in roster after disconnect)
selected_row wasn’t reset
-rw-r--r--src/core.py1
-rw-r--r--src/tabs.py1
-rw-r--r--src/windows.py5
3 files changed, 5 insertions, 2 deletions
diff --git a/src/core.py b/src/core.py
index 20e09b39..194c6f88 100644
--- a/src/core.py
+++ b/src/core.py
@@ -3447,6 +3447,7 @@ class Core(object):
"""
When we are disconnected from remote server
"""
+ roster.modified()
for tab in self.tabs:
if isinstance(tab, tabs.MucTab):
tab.disconnect()
diff --git a/src/tabs.py b/src/tabs.py
index db534a72..c4615f0c 100644
--- a/src/tabs.py
+++ b/src/tabs.py
@@ -2963,7 +2963,6 @@ class RosterInfoTab(Tab):
while not found_group and pos >= 0:
row = self.roster_win.roster_cache[pos]
pos -= 1
- log.debug(row)
if isinstance(row, RosterGroup):
found_group = True
group = row.name
diff --git a/src/windows.py b/src/windows.py
index 551f20af..5e14c3d4 100644
--- a/src/windows.py
+++ b/src/windows.py
@@ -2007,6 +2007,8 @@ class RosterWin(Win):
with g_lock:
# make sure we are within bounds
self.move_cursor_up((self.roster_len + self.pos) if self.pos >= self.roster_len else 0)
+ if not self.roster_cache:
+ self.selected_row = None
self._win.erase()
self._win.move(0, 0)
self.draw_roster_information(roster)
@@ -2016,8 +2018,9 @@ class RosterWin(Win):
if self.start_pos+self.height <= self.pos+2:
self.scroll_down(self.pos - self.start_pos - self.height + (self.height//2))
# draw the roster from the cache
- for item in self.roster_cache[self.start_pos-1:self.start_pos+self.height]:
+ roster_view = self.roster_cache[self.start_pos-1:self.start_pos+self.height]
+ for item in roster_view:
draw_selected = False
if y -2 + self.start_pos == self.pos:
draw_selected = True