From 544bbb12065c102fb9366eadcbf5e445c662a6b9 Mon Sep 17 00:00:00 2001 From: Yann Leboulanger Date: Sun, 24 Apr 2005 15:47:08 +0000 Subject: [PATCH] AGENT_INFO_INFO now send the node --- src/common/connection.py | 2 +- src/config.py | 52 +++++++++++++++++++--------------------- src/gajim.py | 4 ++-- 3 files changed, 27 insertions(+), 31 deletions(-) diff --git a/src/common/connection.py b/src/common/connection.py index 0e1b750b6..b1055944b 100644 --- a/src/common/connection.py +++ b/src/common/connection.py @@ -371,7 +371,7 @@ class Connection: if not identities: self.connection.browseAgents(jid, node) else: - self.dispatch('AGENT_INFO_INFO', (jid, identities, features)) + self.dispatch('AGENT_INFO_INFO', (jid, node, identities, features)) self.connection.discoverItems(jid, node) def _VersionCB(self, con, iq_obj): diff --git a/src/config.py b/src/config.py index b9560b7e4..04185d952 100644 --- a/src/config.py +++ b/src/config.py @@ -1628,9 +1628,29 @@ class Service_discovery_window: self.browse(child_jid, child_node) child = model.iter_next(child) - def agent_info_info(self, agent, identities, features): + def agent_info_info(self, agent, node, identities, features): '''When we recieve informations about an agent, but not its items''' - self.agent_info(agent, identities, features, []) + model = self.services_treeview.get_model() + iter = model.get_iter_root() + # We look if this agent is in the treeview + while (iter): + if agent == model.get_value(iter, 1) and node == model.get_value( + iter, 2): + break + if model.iter_has_child(iter): + iter = model.iter_children(iter) + else: + if not model.iter_next(iter): + iter = model.iter_parent(iter) + if iter: + iter = model.iter_next(iter) + if not iter: #If it is not we stop + return + self.agent_infos[agent + node]['features'] = features + if len(identities): + self.agent_infos[agent + node]['identities'] = identities + if identities[0].has_key('name'): + model.set_value(iter, 0, identities[0]['name']) def agent_info_items(self, agent, node, items): '''When we recieve items about an agent''' @@ -1677,32 +1697,8 @@ class Service_discovery_window: def agent_info(self, agent, identities, features, items): '''When we recieve informations about an agent''' - model = self.services_treeview.get_model() - iter = model.get_iter_root() - node = '' - if len(identities): - if identities[0].has_key('node'): - node = identities[0]['node'] - # We look if this agent is in the treeview - while (iter): - if agent == model.get_value(iter, 1) and node == model.get_value( - iter, 2): - break - if model.iter_has_child(iter): - iter = model.iter_children(iter) - else: - if not model.iter_next(iter): - iter = model.iter_parent(iter) - if iter: - iter = model.iter_next(iter) - if not iter: #If it is not we stop - return - self.agent_infos[agent + node]['features'] = features - if len(identities): - self.agent_infos[agent + node]['identities'] = identities - if identities[0].has_key('name'): - model.set_value(iter, 0, identities[0]['name']) - self.agent_info_items(agent, node, items) + self.agent_info_info(agent, '', identities, features) + self.agent_info_items(agent, '', items) def on_refresh_button_clicked(self, widget): '''When refresh button is clicked: refresh list: clear and rerequest it''' diff --git a/src/gajim.py b/src/gajim.py index 6213fd3c9..fe8bdf38e 100755 --- a/src/gajim.py +++ b/src/gajim.py @@ -356,10 +356,10 @@ class Interface: array[2]) def handle_event_agent_info_info(self, account, array): - #('AGENT_INFO_INFO', account, (agent, identities, features)) + #('AGENT_INFO_INFO', account, (agent, node, identities, features)) if self.windows[account].has_key('disco'): self.windows[account]['disco'].agent_info_info(array[0], array[1], \ - array[2]) + array[2], array[3]) def handle_event_acc_ok(self, account, array): #('ACC_OK', account, (hostname, login, pasword, name, resource, prio,