diff src/bridge/DBus.py @ 425:e4e9187e3b5b

backend, bridge: asynchronous history quick_frontend: use of asynchronous history
author Goffi <goffi@goffi.org>
date Tue, 08 Nov 2011 01:08:11 +0100
parents 72c13313b6d6
children 17c7e48bf68f
line wrap: on
line diff
--- a/src/bridge/DBus.py	Mon Nov 07 22:27:07 2011 +0100
+++ b/src/bridge/DBus.py	Tue Nov 08 01:08:11 2011 +0100
@@ -80,13 +80,13 @@
         result = self.cb[name](*args, **kwargs)
         if async:
             if not isinstance(result, Deferred):
-                error("Asynchrone method [%s] does not return a Deferred." % name)
+                error("Asynchronous method [%s] does not return a Deferred." % name)
                 raise AsyncNotDeferred
             result.addCallback(callback)
             result.addErrback(lambda err:errback(GenericException(err)))
         else:
             if isinstance(result, Deferred):
-                error("Synchrone method [%s] return a Deferred." % name)
+                error("Synchronous method [%s] return a Deferred." % name)
                 raise DeferredNotAsync
             return result
 
@@ -252,10 +252,10 @@
         return self._callback("getContacts", unicode(profile_key))
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
-                         in_signature='ssi', out_signature='a{i(ss)}',
-                         async_callbacks=None)
-    def getHistory(self, from_jid, to_jid, size):
-        return self._callback("getHistory", unicode(from_jid), unicode(to_jid), size)
+                         in_signature='ssib', out_signature='a{i(sss)}',
+                         async_callbacks=('callback', 'errback'))
+    def getHistory(self, from_jid, to_jid, limit, between=True, callback=None, errback=None):
+        return self._callback("getHistory", unicode(from_jid), unicode(to_jid), limit, between, callback=callback, errback=errback)
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='ss', out_signature='s',