Mercurial > libervia-backend
comparison 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 |
comparison
equal
deleted
inserted
replaced
1261:93bce9e4c9c8 | 1262:f8a8434dbac7 |
---|---|
228 def confirmationAnswer(self, id, accepted, data, profile): | 228 def confirmationAnswer(self, id, accepted, data, profile): |
229 return self._callback("confirmationAnswer", unicode(id), accepted, data, unicode(profile)) | 229 return self._callback("confirmationAnswer", unicode(id), accepted, data, unicode(profile)) |
230 | 230 |
231 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 231 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
232 in_signature='ss', out_signature='', | 232 in_signature='ss', out_signature='', |
233 async_callbacks=None) | 233 async_callbacks=('callback', 'errback')) |
234 def delContact(self, entity_jid, profile_key="@DEFAULT@"): | 234 def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None): |
235 return self._callback("delContact", unicode(entity_jid), unicode(profile_key)) | 235 return self._callback("delContact", unicode(entity_jid), unicode(profile_key), callback=callback, errback=errback) |
236 | 236 |
237 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 237 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
238 in_signature='ss', out_signature='(asa(sss))', | 238 in_signature='ss', out_signature='(asa(sss))', |
239 async_callbacks=('callback', 'errback')) | 239 async_callbacks=('callback', 'errback')) |
240 def discoInfos(self, entity_jid, profile_key, callback=None, errback=None): | 240 def discoInfos(self, entity_jid, profile_key, callback=None, errback=None): |
258 def getConfig(self, section, name): | 258 def getConfig(self, section, name): |
259 return self._callback("getConfig", unicode(section), unicode(name)) | 259 return self._callback("getConfig", unicode(section), unicode(name)) |
260 | 260 |
261 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 261 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
262 in_signature='s', out_signature='a(sa{ss}as)', | 262 in_signature='s', out_signature='a(sa{ss}as)', |
263 async_callbacks=None) | 263 async_callbacks=('callback', 'errback')) |
264 def getContacts(self, profile_key="@DEFAULT@"): | 264 def getContacts(self, profile_key="@DEFAULT@", callback=None, errback=None): |
265 return self._callback("getContacts", unicode(profile_key)) | 265 return self._callback("getContacts", unicode(profile_key), callback=callback, errback=errback) |
266 | 266 |
267 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 267 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
268 in_signature='ss', out_signature='as', | 268 in_signature='ss', out_signature='as', |
269 async_callbacks=None) | 269 async_callbacks=None) |
270 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"): | 270 def getContactsFromGroup(self, group, profile_key="@DEFAULT@"): |
432 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): | 432 def subscription(self, sub_type, entity, profile_key="@DEFAULT@"): |
433 return self._callback("subscription", unicode(sub_type), unicode(entity), unicode(profile_key)) | 433 return self._callback("subscription", unicode(sub_type), unicode(entity), unicode(profile_key)) |
434 | 434 |
435 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, | 435 @dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX, |
436 in_signature='ssass', out_signature='', | 436 in_signature='ssass', out_signature='', |
437 async_callbacks=None) | 437 async_callbacks=('callback', 'errback')) |
438 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@"): | 438 def updateContact(self, entity_jid, name, groups, profile_key="@DEFAULT@", callback=None, errback=None): |
439 return self._callback("updateContact", unicode(entity_jid), unicode(name), groups, unicode(profile_key)) | 439 return self._callback("updateContact", unicode(entity_jid), unicode(name), groups, unicode(profile_key), callback=callback, errback=errback) |
440 | 440 |
441 def __attributes(self, in_sign): | 441 def __attributes(self, in_sign): |
442 """Return arguments to user given a in_sign | 442 """Return arguments to user given a in_sign |
443 @param in_sign: in_sign in the short form (using s,a,i,b etc) | 443 @param in_sign: in_sign in the short form (using s,a,i,b etc) |
444 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")""" | 444 @return: list of arguments that correspond to a in_sign (e.g.: "sss" return "arg1, arg2, arg3")""" |