core, bridge: new devicesInfosGet method to get infos on known devices of an entity

This commit is contained in:
Goffi 2020-03-06 18:19:03 +01:00
commit 5a467b15d5
2 changed files with 139 additions and 11 deletions

View file

@ -944,6 +944,19 @@ doc_return=session informations, with at least the following keys:
jid: current full jid
started: date of creation of the session (Epoch time)
[devicesInfosGet]
async=
type=method
category=core
sig_in=ss
sig_out=s
doc=Get various informations on an entity devices
doc_param_0=bare_jid: get data on known devices from this entity
empty string to get devices of the profile
doc_param_1=%(doc_profile_key)s
doc_return=list of known devices, where each item is a dict with a least following keys:
resource: device resource
[namespacesGet]
type=method
category=core

View file

@ -258,6 +258,12 @@ class DbusObject(dbus.service.Object):
def delContact(self, entity_jid, profile_key="@DEFAULT@", callback=None, errback=None):
return self._callback("delContact", str(entity_jid), str(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='ss', out_signature='s',
async_callbacks=('callback', 'errback'))
def devicesInfosGet(self, bare_jid, profile_key, callback=None, errback=None):
return self._callback("devicesInfosGet", str(bare_jid), str(profile_key), callback=callback, errback=errback)
@dbus.service.method(const_INT_PREFIX+const_CORE_SUFFIX,
in_signature='asa(ss)bbbbbs', out_signature='(a{sa(sss)}a{sa(sss)}a{sa(sss)})',
async_callbacks=('callback', 'errback'))