message sending bug fixes + sortilege update

- sortilege now use default profile. /!\ sortilege is really buggy currently, need some attention
This commit is contained in:
Goffi 2010-02-04 01:06:36 +11:00
commit 9fd444d937

View file

@ -30,18 +30,18 @@ class QuickChat():
self.to_jid = to_jid
self.host = host
def historyPrint(self, size=20, keep_last=False):
def historyPrint(self, size=20, keep_last=False, profile='@NONE@'):
"""Print the initial history"""
debug ("now we print history")
history=self.host.bridge.getHistory(self.host.whoami.short, self.to_jid, 20)
history=self.host.bridge.getHistory(self.host.profiles[profile]['whoami'].short, self.to_jid, 20)
stamps=history.keys()
stamps.sort()
for stamp in stamps:
self.printMessage(JID(history[stamp][0]), history[stamp][1], stamp)
self.printMessage(JID(history[stamp][0]), history[stamp][1], profile, stamp)
if keep_last: ##FIXME hack for sortilege
self.last_history = stamps[-1] if stamps else None
def printMessage(self, from_jid, msg, timestamp):
def printMessage(self, from_jid, msg, profile, timestamp):
"""Print message in chat window. Must be implemented by child class"""
raise NotImplementedError