diff frontends/src/quick_frontend/quick_chat.py @ 1223:802b7e6bf098

frontends: printInfo and printMessage timestamp attribute defaults to None instead of ''
author souliane <souliane@mailoo.org>
date Sat, 04 Oct 2014 10:23:13 +0200
parents e6e0ea4dc835
children f0c9b149ed99
line wrap: on
line diff
--- a/frontends/src/quick_frontend/quick_chat.py	Wed Sep 24 13:49:43 2014 +0200
+++ b/frontends/src/quick_frontend/quick_chat.py	Sat Oct 04 10:23:13 2014 +0200
@@ -134,9 +134,9 @@
                 return unescaped.resource
         return jid.resource if self.type == "group" else (self.host.contact_list.getCache(jid,'nick') or self.host.contact_list.getCache(jid,'name') or jid.node)
 
-    def printMessage(self, from_jid, msg, profile, timestamp = ''):
+    def printMessage(self, from_jid, msg, profile, timestamp=None):
         """Print message in chat window. Must be implemented by child class"""
-        jid=JID(from_jid)
+        jid = JID(from_jid)
         nick = self._get_nick(jid)
         mymess = (jid.resource == self.nick) if self.type == "group" else (jid.bare == self.host.profiles[profile]['whoami'].bare) #mymess = True if message comes from local user
         if msg.startswith('/me '):
@@ -144,12 +144,13 @@
             return
         return jid, nick, mymess
 
-    def printInfo(self, msg, type_='normal'):
+    def printInfo(self, msg, type_='normal', timestamp=None):
         """Print general info
         @param msg: message to print
         @type_: one of:
             normal: general info like "toto has joined the room"
             me: "/me" information like "/me clenches his fist" ==> "toto clenches his fist"
+        @param timestamp (float): number of seconds since epoch
         """
         raise NotImplementedError