diff src/bridge/DBus.py @ 1262:f8a8434dbac7 frontends_multi_profiles

core: improved roster management + misc: - updated methods to no use anymore methods deprecated in Wokkel - use of full jid when it make sense instead of bare jid - getContacts, updateContact and delContact are now asynchronous
author Goffi <goffi@goffi.org>
date Wed, 10 Dec 2014 18:32:33 +0100
parents f0c9b149ed99
children faa1129559b8
line wrap: on
line diff
--- a/src/bridge/DBus.py	Mon Nov 24 17:20:51 2014 +0100
+++ b/src/bridge/DBus.py	Wed Dec 10 18:32:33 2014 +0100
@@ -230,9 +230,9 @@
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='ss', out_signature='',
-                         async_callbacks=None)
-    def delContact(self, entity_jid, profile_key="@DEFAULT@"):
-        return self._callback("delContact", unicode(entity_jid), unicode(profile_key))
+                         async_callbacks=('callback', 'errback'))
+    def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
+        return self._callback("delContact", unicode(entity_jid), unicode(profile_key), callback=callback, errback=errback)
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='ss', out_signature='(asa(sss))',
@@ -260,9 +260,9 @@
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='s', out_signature='a(sa{ss}as)',
-                         async_callbacks=None)
-    def getContacts(self, profile_key="@DEFAULT@"):
-        return self._callback("getContacts", unicode(profile_key))
+                         async_callbacks=('callback', 'errback'))
+    def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None):
+        return self._callback("getContacts", unicode(profile_key), callback=callback, errback=errback)
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='ss', out_signature='as',
@@ -434,9 +434,9 @@
 
     @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
                          in_signature='ssass', out_signature='',
-                         async_callbacks=None)
-    def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"):
-        return self._callback("updateContact", unicode(entity_jid), unicode(name), groups, unicode(profile_key))
+                         async_callbacks=('callback', 'errback'))
+    def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None):
+        return self._callback("updateContact", unicode(entity_jid), unicode(name), groups, unicode(profile_key), callback=callback, errback=errback)
 
     def __attributes(self, in_sign):
         """Return arguments to user given a in_sign