Mercurial > libervia-backend
diff src/memory/disco.py @ 2150:91347fe95384
core(memory.disco), bridge: discoInfos and discoItems now handle node
author | Goffi <goffi@goffi.org> |
---|---|
date | Sun, 12 Feb 2017 21:17:56 +0100 |
parents | a543eda2c923 |
children | f047d5410040 |
line wrap: on
line diff
--- a/src/memory/disco.py Sun Feb 12 21:17:56 2017 +0100 +++ b/src/memory/disco.py Sun Feb 12 21:17:56 2017 +0100 @@ -308,15 +308,16 @@ return cap_hash @defer.inlineCallbacks - def _discoInfos(self, entity_jid_s, profile_key=C.PROF_KEY_NONE): + def _discoInfos(self, entity_jid_s, node=u'', profile_key=C.PROF_KEY_NONE): """ Discovery method for the bridge @param entity_jid_s: entity we want to discover + @param node(unicode): optional node to use @return: list of tuples """ client = self.host.getClient(profile_key) entity = jid.JID(entity_jid_s) - disco_infos = yield self.getInfos(client, entity) + disco_infos = yield self.getInfos(client, entity, node) extensions = {} for form_type, form in disco_infos.extensions.items(): fields = [] @@ -349,13 +350,14 @@ yield (item.entity.full(), item.nodeIdentifier or '', item.name or '') @defer.inlineCallbacks - def _discoItems(self, entity_jid_s, profile_key=C.PROF_KEY_NONE): + def _discoItems(self, entity_jid_s, node=u'', profile_key=C.PROF_KEY_NONE): """ Discovery method for the bridge @param entity_jid_s: entity we want to discover + @param node(unicode): optional node to use @return: list of tuples""" client = self.host.getClient(profile_key) entity = jid.JID(entity_jid_s) - disco_items = yield self.getItems(client, entity) + disco_items = yield self.getItems(client, entity, node) ret = list(self.items2tuples(disco_items)) defer.returnValue(ret)