comparison sat_frontends/bridge/pb.py @ 3206:ae09989e9feb

core, bridge: new `devicesInfosGet` method to get infos on known devices of an entity
author Goffi <goffi@goffi.org>
date Fri, 06 Mar 2020 18:19:03 +0100
parents 439e2f88c3a9
children f2e30aa031e9
comparison
equal deleted inserted replaced
3205:2c0628f3927e 3206:ae09989e9feb
197 d.addCallback(lambda __: callback()) 197 d.addCallback(lambda __: callback())
198 if errback is None: 198 if errback is None:
199 errback = self._generic_errback 199 errback = self._generic_errback
200 d.addErrback(errback) 200 d.addErrback(errback)
201 201
202 def devicesInfosGet(self, bare_jid, profile_key, callback=None, errback=None):
203 d = self.root.callRemote("devicesInfosGet", bare_jid, profile_key)
204 if callback is not None:
205 d.addCallback(callback)
206 if errback is None:
207 errback = self._generic_errback
208 d.addErrback(errback)
209
202 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None): 210 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@", callback=None, errback=None):
203 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key) 211 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
204 if callback is not None: 212 if callback is not None:
205 d.addCallback(callback) 213 d.addCallback(callback)
206 if errback is None: 214 if errback is None:
709 def delContact(self, entity_jid, profile_key="@DEFAULT@"): 717 def delContact(self, entity_jid, profile_key="@DEFAULT@"):
710 d = self.root.callRemote("delContact", entity_jid, profile_key) 718 d = self.root.callRemote("delContact", entity_jid, profile_key)
711 d.addErrback(self._errback) 719 d.addErrback(self._errback)
712 return d.asFuture(asyncio.get_event_loop()) 720 return d.asFuture(asyncio.get_event_loop())
713 721
722 def devicesInfosGet(self, bare_jid, profile_key):
723 d = self.root.callRemote("devicesInfosGet", bare_jid, profile_key)
724 d.addErrback(self._errback)
725 return d.asFuture(asyncio.get_event_loop())
726
714 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"): 727 def discoFindByFeatures(self, namespaces, identities, bare_jid=False, service=True, roster=True, own_jid=True, local_device=False, profile_key="@DEFAULT@"):
715 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key) 728 d = self.root.callRemote("discoFindByFeatures", namespaces, identities, bare_jid, service, roster, own_jid, local_device, profile_key)
716 d.addErrback(self._errback) 729 d.addErrback(self._errback)
717 return d.asFuture(asyncio.get_event_loop()) 730 return d.asFuture(asyncio.get_event_loop())
718 731