From eefb01e746eefee252a892541e36addfad15b4c1 Mon Sep 17 00:00:00 2001
From: Yann Leboulanger <asterix@lagaule.org>
Date: Wed, 30 Mar 2005 20:06:01 +0000
Subject: [PATCH] in service discovery an item can have no name

---
 plugins/gtkgui/config.py | 7 ++++---
 plugins/gtkgui/gtkgui.py | 4 ++--
 2 files changed, 6 insertions(+), 5 deletions(-)

diff --git a/plugins/gtkgui/config.py b/plugins/gtkgui/config.py
index f1e18a868c..c09ab87b84 100644
--- a/plugins/gtkgui/config.py
+++ b/plugins/gtkgui/config.py
@@ -1562,8 +1562,9 @@ class Service_discovery_window:
 		if len(model.get_path(iter)) == 1:
 			expand = True
 		for item in items:
-			if not item.has_key('name'):
-				continue
+			name = ''
+			if item.has_key('name'):
+				name = item['name']
 			# We look if this item is already in the treeview
 			iter_child = model.iter_children(iter)
 			while iter_child:
@@ -1571,7 +1572,7 @@ class Service_discovery_window:
 					break
 				iter_child = model.iter_next(iter_child)
 			if not iter_child: # If it is not we add it
-				iter_child = model.append(iter, (item['name'], item['jid']))
+				iter_child = model.append(iter, (name, item['jid']))
 			self.agent_infos[item['jid']] = {'identities': [item]}
 			if self.iter_is_visible(iter_child) or expand:
 				self.browse(item['jid'])
diff --git a/plugins/gtkgui/gtkgui.py b/plugins/gtkgui/gtkgui.py
index 0c7188abaf..9e3bc34e14 100644
--- a/plugins/gtkgui/gtkgui.py
+++ b/plugins/gtkgui/gtkgui.py
@@ -458,12 +458,12 @@ class plugin:
 				array[2], array[3])
 
 	def handle_event_agent_info_items(self, account, array):
-		#('AGENT_INFO', account, (agent, items))
+		#('AGENT_INFO_ITEMS', account, (agent, items))
 		if self.windows[account].has_key('browser'):
 			self.windows[account]['browser'].agent_info_items(array[0], array[1])
 
 	def handle_event_agent_info_info(self, account, array):
-		#('AGENT_INFO', account, (agent, identities, features))
+		#('AGENT_INFO_INFO', account, (agent, identities, features))
 		if self.windows[account].has_key('browser'):
 			self.windows[account]['browser'].agent_info_info(array[0], array[1], \
 				array[2])
-- 
GitLab