frontends: printInfo and printMessage timestamp attribute defaults to None instead of ''
This commit is contained in:
parent
4f339272b7
commit
7a344fcf5d
1 changed files with 15 additions and 11 deletions
|
|
@ -134,9 +134,9 @@ class QuickChat(object):
|
|||
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 @@ class QuickChat(object):
|
|||
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
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue