summaryrefslogtreecommitdiff
path: root/src/text_buffer.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-25 11:42:12 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-25 11:42:50 +0100
commit06156c3b77ed44cf53ac8c788ee0c2ae239116a3 (patch)
tree5314fd94ddb95b2a79cc18c273ab51a97cb8d298 /src/text_buffer.py
parentbb22b39d559a2faa7817d579115a3f76b6a0ea30 (diff)
downloadpoezio-06156c3b77ed44cf53ac8c788ee0c2ae239116a3.tar.gz
poezio-06156c3b77ed44cf53ac8c788ee0c2ae239116a3.tar.bz2
poezio-06156c3b77ed44cf53ac8c788ee0c2ae239116a3.tar.xz
poezio-06156c3b77ed44cf53ac8c788ee0c2ae239116a3.zip
Use the nick color for the “*” char in /me messages.
Diffstat (limited to 'src/text_buffer.py')
-rw-r--r--src/text_buffer.py9
1 files changed, 8 insertions, 1 deletions
diff --git a/src/text_buffer.py b/src/text_buffer.py
index 9cf5e0d5..2dded268 100644
--- a/src/text_buffer.py
+++ b/src/text_buffer.py
@@ -37,7 +37,14 @@ class TextBuffer(object):
def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None, user=None):
time = time or datetime.now()
if txt.startswith('/me '):
- txt = "\x192}* \x195}" + nickname + ' ' + txt[4:]
+ if nick_color:
+ color = nick_color[0]
+ elif user:
+ color = user.color[0]
+ else:
+ color = None
+ # TODO: display the bg color too.
+ txt = ("\x19%s}* \x195}" % (color,))+ nickname + ' ' + txt[4:]
nickname = None
msg = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color,
time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\