Commit 40af34ad authored by mathieui's avatar mathieui

Fix #2372 (traceback on space in roster after disconnect)

selected_row wasn’t reset
parent b245ff6e
......@@ -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()
......
......@@ -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
......
......@@ -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
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment