From 118a81992dd7ea8ef34eeac565d092f0e5191eb1 Mon Sep 17 00:00:00 2001 From: Florent Le Coz Date: Wed, 4 May 2011 23:08:58 +0200 Subject: Fix /recolor correctly, and also fixes #2158 --- src/room.py | 5 +++-- src/windows.py | 6 +++--- 2 files changed, 6 insertions(+), 5 deletions(-) (limited to 'src') diff --git a/src/room.py b/src/room.py index 4bb6b8b1..3ff655fb 100644 --- a/src/room.py +++ b/src/room.py @@ -60,7 +60,8 @@ class Room(TextBuffer): color = None if not time and nickname and nickname != self.own_nick and self.joined: if self.own_nick.lower() in txt.lower(): - self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) + if self.color_state != theme.COLOR_TAB_CURRENT: + self.set_color_state(theme.COLOR_TAB_HIGHLIGHT) color = theme.COLOR_HIGHLIGHT_NICK else: highlight_words = config.get('highlight_on', '').split(':') @@ -105,7 +106,7 @@ 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) - nick_color = nick_color or user.color if user else None + nick_color = nick_color or None if not nickname or time: txt = '\x195%s' % (txt,) else: # TODO diff --git a/src/windows.py b/src/windows.py index 53cd0781..ea4bfca2 100644 --- a/src/windows.py +++ b/src/windows.py @@ -576,10 +576,10 @@ class TextWin(Win): while txt != '': (txt, cutted_txt) = cut_text(txt, self.width-offset-1) if first: - if message.user: - color = message.user.color - elif message.nick_color: + if message.nick_color: color = message.nick_color + elif message.user: + color = message.user.color else: color = None else: -- cgit v1.2.3