fix the /recolor command

parent ff24960b
...@@ -1213,12 +1213,11 @@ class Core(object): ...@@ -1213,12 +1213,11 @@ class Core(object):
Move the new-messages separator at the bottom on the current Move the new-messages separator at the bottom on the current
text. text.
""" """
try: window = self.current_tab().get_text_window()
room = self.current_tab().get_room() if not window:
except:
return return
room.remove_line_separator() window.remove_line_separator()
room.add_line_separator() window.add_line_separator()
self.refresh_window() self.refresh_window()
def information(self, msg, typ=''): def information(self, msg, typ=''):
......
...@@ -124,6 +124,12 @@ class Tab(object): ...@@ -124,6 +124,12 @@ class Tab(object):
""" """
raise NotImplementedError raise NotImplementedError
def get_text_window(self):
"""
Returns the principal TextWin window, if there's one
"""
return None
def on_input(self, key): def on_input(self, key):
pass pass
...@@ -348,6 +354,7 @@ class MucTab(ChatTab): ...@@ -348,6 +354,7 @@ class MucTab(ChatTab):
for user in sorted(users, key=compare_users, reverse=True): for user in sorted(users, key=compare_users, reverse=True):
user.color = theme.LIST_COLOR_NICKNAMES[i % nb_color] user.color = theme.LIST_COLOR_NICKNAMES[i % nb_color]
i+= 1 i+= 1
self.text_win.rebuild_everything(self.get_room())
self.core.refresh_window() self.core.refresh_window()
def command_nick(self, arg): def command_nick(self, arg):
...@@ -540,6 +547,9 @@ class MucTab(ChatTab): ...@@ -540,6 +547,9 @@ class MucTab(ChatTab):
def get_name(self): def get_name(self):
return self._room.name return self._room.name
def get_text_window(self):
return self.text_win
def get_room(self): def get_room(self):
return self._room return self._room
...@@ -664,6 +674,9 @@ class PrivateTab(ChatTab): ...@@ -664,6 +674,9 @@ class PrivateTab(ChatTab):
def get_room(self): def get_room(self):
return self._room return self._room
def get_text_window(self):
return self.text_win
def just_before_refresh(self): def just_before_refresh(self):
return return
...@@ -939,6 +952,9 @@ class ConversationTab(ChatTab): ...@@ -939,6 +952,9 @@ class ConversationTab(ChatTab):
def get_room(self): def get_room(self):
return self._room return self._room
def get_text_window(self):
return self.text_win
def just_before_refresh(self): def just_before_refresh(self):
return return
......
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