comparison browser_side/panels.py @ 123:5cb852d9757e

use of async history
author Goffi <goffi@goffi.org>
date Sat, 10 Dec 2011 12:26:43 +0100
parents 054b7b3424a3
children e19a8de8b3de
comparison
equal deleted inserted replaced
122:397a88b340f3 123:5cb852d9757e
690 self.printInfo("<= %s has left the room" % nick) 690 self.printInfo("<= %s has left the room" % nick)
691 691
692 def historyPrint(self, size=20): 692 def historyPrint(self, size=20):
693 """Print the initial history""" 693 """Print the initial history"""
694 def getHistoryCB(history): 694 def getHistoryCB(history):
695 stamps=history.keys() 695 for line in history:
696 stamps.sort() 696 timestamp, from_jid, to_jid, message = line
697 for stamp in stamps: 697 self.printMessage(from_jid, message, timestamp)
698 self.printMessage(history[stamp][0], history[stamp][1], stamp) 698 self.host.bridge.call('getHistory', getHistoryCB, self.host.whoami.bare, self.target.bare, size, True)
699 self.host.bridge.call('getHistory', getHistoryCB, self.host.whoami.bare, self.target.bare, 20)
700 699
701 def printInfo(self, msg, type='normal'): 700 def printInfo(self, msg, type='normal'):
702 """Print general info 701 """Print general info
703 @param msg: message to print 702 @param msg: message to print
704 @type: one of: 703 @type: one of: