discover correctly items that are discoverable. see #3479

This commit is contained in:
Yann Leboulanger 2007-10-22 08:54:07 +00:00
parent 77eab243e6
commit a3c7989ba4
1 changed files with 5 additions and 1 deletions

View File

@ -67,6 +67,7 @@ def _gen_agent_type_info():
# Jabber server # Jabber server
('server', 'im'): (ToplevelAgentBrowser, 'jabber.png'), ('server', 'im'): (ToplevelAgentBrowser, 'jabber.png'),
('services', 'jabber'): (ToplevelAgentBrowser, 'jabber.png'), ('services', 'jabber'): (ToplevelAgentBrowser, 'jabber.png'),
('hierarchy', 'branch'): (AgentBrowser, 'jabber.png'),
# Services # Services
('conference', 'text'): (MucBrowser, 'conference.png'), ('conference', 'text'): (MucBrowser, 'conference.png'),
@ -953,6 +954,7 @@ _('This service does not contain any items to browse.'))
disco#items query.''' disco#items query.'''
self.model.append((jid, node, item.get('name', ''), self.model.append((jid, node, item.get('name', ''),
get_agent_address(jid, node))) get_agent_address(jid, node)))
self.cache.get_info(jid, node, self._agent_info, force = force)
def _update_item(self, iter, jid, node, item): def _update_item(self, iter, jid, node, item):
'''Called when an item should be updated in the model. The result of a '''Called when an item should be updated in the model. The result of a
@ -963,7 +965,9 @@ _('This service does not contain any items to browse.'))
def _update_info(self, iter, jid, node, identities, features, data): def _update_info(self, iter, jid, node, identities, features, data):
'''Called when an item should be updated in the model with further info. '''Called when an item should be updated in the model with further info.
The result of a disco#info query.''' The result of a disco#info query.'''
self.model[iter][2] = identities[0].get('name', '') name = identities[0].get('name', '')
if name:
self.model[iter][2] = name
def _update_error(self, iter, jid, node): def _update_error(self, iter, jid, node):
'''Called when a disco#info query failed for an item.''' '''Called when a disco#info query failed for an item.'''