summaryrefslogtreecommitdiff
path: root/src/text_buffer.py
diff options
context:
space:
mode:
authorFlorent Le Coz <louiz@louiz.org>2011-11-06 03:41:00 +0100
committerFlorent Le Coz <louiz@louiz.org>2011-11-06 03:41:00 +0100
commitd76b37f825b53e0b55eb0f8d95c7f8eb7d3d7eff (patch)
tree426e51859068761c4252d302e51a8c8db456da5f /src/text_buffer.py
parent432afd6179e69b70b290fef68ea3bb263ff3b4c1 (diff)
parent9ff6380149980581bc74f33ddd0e38fb0627623b (diff)
downloadpoezio-d76b37f825b53e0b55eb0f8d95c7f8eb7d3d7eff.tar.gz
poezio-d76b37f825b53e0b55eb0f8d95c7f8eb7d3d7eff.tar.bz2
poezio-d76b37f825b53e0b55eb0f8d95c7f8eb7d3d7eff.tar.xz
poezio-d76b37f825b53e0b55eb0f8d95c7f8eb7d3d7eff.zip
Merge branch 'master' into plugins
Diffstat (limited to 'src/text_buffer.py')
-rw-r--r--src/text_buffer.py7
1 files changed, 4 insertions, 3 deletions
diff --git a/src/text_buffer.py b/src/text_buffer.py
index f39f147a..eb4b7b79 100644
--- a/src/text_buffer.py
+++ b/src/text_buffer.py
@@ -34,19 +34,20 @@ class TextBuffer(object):
def add_window(self, win):
self.windows.append(win)
- def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None):
+ def add_message(self, txt, time=None, nickname=None, nick_color=None, history=None, user=None):
time = time or datetime.now()
msg = Message(txt='%s\x19o'%(txt.replace('\t', ' '),), nick_color=nick_color,
time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\
if history else time.strftime("%H:%M:%S"),\
- nickname=nickname, user=None)
+ nickname=nickname, user=user)
+ log.debug('Coucou, le message ajouté : %s' % (msg,))
self.messages.append(msg)
while len(self.messages) > self.messages_nb_limit:
self.messages.pop(0)
ret_val = None
for window in self.windows: # make the associated windows
# build the lines from the new message
- nb = window.build_new_message(msg)
+ nb = window.build_new_message(msg, history=history)
if ret_val is None:
ret_val = nb
if window.pos != 0: