summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-05-04 23:08:58 +0200
committerFlorent Le Coz <louiz@louiz.org>2011-05-04 23:08:58 +0200
commit118a81992dd7ea8ef34eeac565d092f0e5191eb1 (patch)
tree5237d5b1fd8de67b80f7d0739fd9691fc38d51ac /src
parentc784deea9c6a3a2d19a6bfe56d2eae92e9c901f5 (diff)
downloadpoezio-118a81992dd7ea8ef34eeac565d092f0e5191eb1.tar.gz
poezio-118a81992dd7ea8ef34eeac565d092f0e5191eb1.tar.bz2
poezio-118a81992dd7ea8ef34eeac565d092f0e5191eb1.tar.xz
poezio-118a81992dd7ea8ef34eeac565d092f0e5191eb1.zip
Fix /recolor correctly, and also fixes #2158
Diffstat (limited to 'src')
-rw-r--r--src/room.py5
-rw-r--r--src/windows.py6
2 files changed, 6 insertions, 5 deletions
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: