[Sugar-devel] [PATCH sugar] Gabble: do not add ourself to the model twice OLPC #10965

Simon Schampijer simon at schampijer.de
Sun Jun 26 09:19:49 EDT 2011


We do add ourself to the model by default. When we are connected
to the server it often gives us as well ourself back.

Signed-off-by: Simon Schampijer <simon at laptop.org>
---
 src/jarabe/model/neighborhood.py |    5 +++++
 1 files changed, 5 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
index 9a2852a..96cbb36 100644
--- a/src/jarabe/model/neighborhood.py
+++ b/src/jarabe/model/neighborhood.py
@@ -594,6 +594,11 @@ class _Account(gobject.GObject):
         for handle in attributes.keys():
             nick = attributes[handle][CONNECTION_INTERFACE_ALIASING + '/alias']
 
+            if handle == self._self_handle:
+                logging.debug('_Account.__get_contact_attributes_cb,' \
+                              ' do not add ourself %r', handle)
+                continue
+
             if handle in self._buddy_handles and \
                     not self._buddy_handles[handle] is None:
                 logging.debug('Got handle %r with nick %r, going to update',
-- 
1.7.4.4



More information about the Sugar-devel mailing list