comparison frontends/quick_frontend/quick_chat.py @ 67:0e50dd3a234a

message sending bug fixes + sortilege update - sortilege now use default profile. /!\ sortilege is really buggy currently, need some attention
author Goffi <goffi@goffi.org>
date Thu, 04 Feb 2010 01:06:36 +1100
parents a5b5fb5fc9fd
children 8f2ed279784b
comparison
equal deleted inserted replaced
66:8147b4f40809 67:0e50dd3a234a
28 28
29 def __init__(self, to_jid, host): 29 def __init__(self, to_jid, host):
30 self.to_jid = to_jid 30 self.to_jid = to_jid
31 self.host = host 31 self.host = host
32 32
33 def historyPrint(self, size=20, keep_last=False): 33 def historyPrint(self, size=20, keep_last=False, profile='@NONE@'):
34 """Print the initial history""" 34 """Print the initial history"""
35 debug ("now we print history") 35 debug ("now we print history")
36 history=self.host.bridge.getHistory(self.host.whoami.short, self.to_jid, 20) 36 history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.to_jid, 20)
37 stamps=history.keys() 37 stamps=history.keys()
38 stamps.sort() 38 stamps.sort()
39 for stamp in stamps: 39 for stamp in stamps:
40 self.printMessage(JID(history[stamp][0]), history[stamp][1], stamp) 40 self.printMessage(JID(history[stamp][0]), history[stamp][1], profile, stamp)
41 if keep_last: ##FIXME hack for sortilege 41 if keep_last: ##FIXME hack for sortilege
42 self.last_history = stamps[-1] if stamps else None 42 self.last_history = stamps[-1] if stamps else None
43 43
44 def printMessage(self, from_jid, msg, timestamp): 44 def printMessage(self, from_jid, msg, profile, timestamp):
45 """Print message in chat window. Must be implemented by child class""" 45 """Print message in chat window. Must be implemented by child class"""
46 raise NotImplementedError 46 raise NotImplementedError
47 47