diff 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
line wrap: on
line diff
--- a/browser_side/panels.py	Sat Dec 10 11:32:14 2011 +0100
+++ b/browser_side/panels.py	Sat Dec 10 12:26:43 2011 +0100
@@ -692,11 +692,10 @@
     def historyPrint(self, size=20):
         """Print the initial history"""
         def getHistoryCB(history):
-            stamps=history.keys()
-            stamps.sort()
-            for stamp in stamps:
-                self.printMessage(history[stamp][0], history[stamp][1], stamp)
-        self.host.bridge.call('getHistory', getHistoryCB, self.host.whoami.bare, self.target.bare, 20)
+            for line in history:
+                timestamp, from_jid, to_jid, message = line
+                self.printMessage(from_jid, message, timestamp)
+        self.host.bridge.call('getHistory', getHistoryCB, self.host.whoami.bare, self.target.bare, size, True)
    
     def printInfo(self, msg, type='normal'):
         """Print general info