Gajim is JEP-0011 compliemt now

This commit is contained in:
Yann Leboulanger 2005-05-07 12:24:19 +00:00
parent 56d60f3fd5
commit fab74069c6

View file

@ -321,24 +321,24 @@ class Connection:
def _BrowseResultCB(self, con, iq_obj): def _BrowseResultCB(self, con, iq_obj):
gajim.log.debug('BrowseResultCB') gajim.log.debug('BrowseResultCB')
identities, features, items = [], [], [] identities, features, items = [], [], []
q = iq_obj.getTag('service') for q in iq_obj.getChildren():
if not q: if q.getNamespace() != common.xmpp.NS_BROWSE:
return identities, features, items continue
attr = {} attr = {}
for key in q.getAttrs().keys(): for key in q.getAttrs().keys():
attr[key.encode('utf8')] = q.getAttr(key).encode('utf8') attr[key.encode('utf8')] = q.getAttr(key).encode('utf8')
identities = [attr] identities = [attr]
for node in q.getChildren(): for node in q.getChildren():
if node.getName() == 'ns': if node.getName() == 'ns':
features.append(node.getData()) features.append(node.getData())
else: else:
infos = {} infos = {}
for key in node.getAttrs().keys(): for key in node.getAttrs().keys():
infos[key.encode('utf8')] = node.getAttr(key).encode('utf8') infos[key.encode('utf8')] = node.getAttr(key).encode('utf8')
infos['category'] = node.getName() infos['category'] = node.getName()
items.append(infos) items.append(infos)
jid = str(iq_obj.getFrom()) jid = str(iq_obj.getFrom())
self.dispatch('AGENT_INFO', (jid, identities, features, items)) self.dispatch('AGENT_INFO', (jid, identities, features, items))
def _DiscoverItemsCB(self, con, iq_obj): def _DiscoverItemsCB(self, con, iq_obj):
gajim.log.debug('DiscoverItemsCB') gajim.log.debug('DiscoverItemsCB')