summaryrefslogtreecommitdiff
path: root/src/room.py
diff options
context:
space:
mode:
Diffstat (limited to 'src/room.py')
-rw-r--r--src/room.py17
1 files changed, 5 insertions, 12 deletions
diff --git a/src/room.py b/src/room.py
index 5d4c4ce6..1ca3f599 100644
--- a/src/room.py
+++ b/src/room.py
@@ -1,18 +1,9 @@
-# Copyright 2010-2011 Le Coz Florent <louiz@louiz.org>
+# Copyright 2010-2011 Florent Le Coz <louiz@louiz.org>
#
# This file is part of Poezio.
#
# Poezio is free software: you can redistribute it and/or modify
-# it under the terms of the GNU General Public License as published by
-# the Free Software Foundation, version 3 of the License.
-#
-# Poezio is distributed in the hope that it will be useful,
-# but WITHOUT ANY WARRANTY; without even the implied warranty of
-# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
-# GNU General Public License for more details.
-#
-# You should have received a copy of the GNU General Public License
-# along with Poezio. If not, see <http://www.gnu.org/licenses/>.
+# it under the terms of the MIT license. See the COPYING file.
from text_buffer import TextBuffer, Message
from datetime import datetime
@@ -129,7 +120,9 @@ class Room(TextBuffer):
nick_color = highlight
time = time or datetime.now()
message = Message(txt='%s\x19o'%(txt,), nick_color=nick_color,
- time=time, nickname=nickname, user=user)
+ time=time, str_time=time.strftime("%Y-%m-%d %H:%M:%S")\
+ if history else time.strftime("%H:%M:%S"),\
+ nickname=nickname, user=user)
while len(self.messages) > self.messages_nb_limit:
self.messages.pop(0)
self.messages.append(message)