fix the highlight color

parent 1eba9f41
...@@ -72,13 +72,13 @@ class Room(object): ...@@ -72,13 +72,13 @@ class Room(object):
if not time and nickname != self.own_nick and self.joined and nickname is not None: # do the highlight if not time and nickname != self.own_nick and self.joined and nickname is not None: # do the highlight
try: try:
if self.own_nick.encode('utf-8') in txt: if self.own_nick.encode('utf-8') in txt:
self.set_color_state(13) self.set_color_state(common.ROOM_STATE_HL)
color = 2 color = 4
except UnicodeDecodeError: except UnicodeDecodeError:
try: try:
if self.own_nick in txt: if self.own_nick in txt:
self.set_color_state(13) self.set_color_state(common.ROOM_STATE_HL)
color = 2 color = 4
except: except:
pass pass
else: else:
...@@ -86,7 +86,7 @@ class Room(object): ...@@ -86,7 +86,7 @@ class Room(object):
for word in highlight_words: for word in highlight_words:
if word.lower() in txt.lower() and word != '': if word.lower() in txt.lower() and word != '':
self.set_color_state(common.ROOM_STATE_HL) self.set_color_state(common.ROOM_STATE_HL)
color = 2 color = 4
break break
return color return color
......
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