core(memory.disco), bridge: discoInfos and discoItems now handle node
This commit is contained in:
parent
749bd76f62
commit
0a2a18ebaf
1 changed files with 26 additions and 18 deletions
|
|
@ -308,15 +308,16 @@ class Discovery(object):
|
|||
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 @@ class Discovery(object):
|
|||
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)
|
||||
|
|
|
|||
Loading…
Reference in a new issue