summaryrefslogtreecommitdiff
path: root/src/room.py
diff options
context:
space:
mode:
authorlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-10 09:05:47 +0000
committerlouiz@4325f9fc-e183-4c21-96ce-0ab188b42d13 <louiz@4325f9fc-e183-4c21-96ce-0ab188b42d13>2010-06-10 09:05:47 +0000
commite3974e8524283e8cc3d4c4df6a51648b8117f5b6 (patch)
treec6d5216544b824da7268d25a5cee7ce47c6f5c11 /src/room.py
parentfa4fbeb23cc243209280b1da5240fc46b9afcfbb (diff)
downloadpoezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.gz
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.bz2
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.tar.xz
poezio-e3974e8524283e8cc3d4c4df6a51648b8117f5b6.zip
The room info bar and highlights work again.
Diffstat (limited to 'src/room.py')
-rw-r--r--src/room.py32
1 files changed, 16 insertions, 16 deletions
diff --git a/src/room.py b/src/room.py
index c9bd1c24..8dfd63d9 100644
--- a/src/room.py
+++ b/src/room.py
@@ -61,26 +61,26 @@ class Room(object):
time = time if time is not None else datetime.now()
from common import debug
# debug("add_message: %s, %s, %s, %s" % (str(txt), str(time), str(nickname), str(user)))
- self.messages.append(Message(txt, time, nickname, user))
+
+ color = None
+ if nickname is not None:
+ self.set_color_state(12)
+ if nickname != self.own_nick and self.joined and nickname is not None: # do the highlight thing
+ if self.own_nick in txt:
+ self.set_color_state(13)
+ color = 3
+ else:
+ highlight_words = config.get('highlight_on', '').split(':')
+ for word in highlight_words:
+ if word.lower() in txt.lower() and word != '':
+ self.set_color_state(13)
+ color = 3
+ break
+ self.messages.append(Message(txt, time, nickname, user, color))
# def add_message(nick, msg, date=None)
# TODO: limit the message kept in memory (configurable)
- # if not date:
- # date = datetime.now()
- # color = None
- # self.set_color_state(12)
- # if nick != self.own_nick and self.joined: # do the highlight thing
- # if self.own_nick in msg:
- # self.set_color_state(13)
- # color = 3
- # else:
- # highlight_words = config.get('highlight_on', '').split(':')
- # for word in highlight_words:
- # if word.lower() in msg.lower() and word != '':
- # self.set_color_state(13)
- # color = 3
- # break
# if not msg:
# logger.info('msg is None..., %s' % (nick))
# return