[Sugar-devel] [PATCH] Make sure we don't change the owner's colors because of a network event #2348

Tomeu Vizoso tomeu.vizoso at collabora.co.uk
Tue Sep 21 09:58:25 EDT 2010


Because the owner is stored in Neighborhood._buddies in the key None.
---
 src/jarabe/model/neighborhood.py |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
index b808e12..ff973fd 100644
--- a/src/jarabe/model/neighborhood.py
+++ b/src/jarabe/model/neighborhood.py
@@ -829,6 +829,10 @@ class Neighborhood(gobject.GObject):
 
     def __buddy_updated_cb(self, account, contact_id, properties):
         logging.debug('__buddy_updated_cb %r', contact_id)
+        if contact_id is None:
+            # Don't know the contact-id yet, will get the full state later
+            return
+
         if contact_id not in self._buddies:
             logging.debug('__buddy_updated_cb Unknown buddy with contact_id %r',
                           contact_id)
-- 
1.7.2.3



More information about the Sugar-devel mailing list