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

Tomeu Vizoso tomeu at sugarlabs.org
Tue Sep 21 09:50:35 EDT 2010


On Mon, Sep 20, 2010 at 22:45, Sascha Silbe
<sascha-ml-reply-to-2010-3 at silbe.org> wrote:
> Excerpts from Tomeu Vizoso's message of Mon Sep 20 14:55:28 +0200 2010:
>
>> ---
>>  src/jarabe/model/neighborhood.py |    2 +-
>>  1 files changed, 1 insertions(+), 1 deletions(-)
>>
>> diff --git a/src/jarabe/model/neighborhood.py b/src/jarabe/model/neighborhood.py
>> index b808e12..76a0a7d 100644
>> --- a/src/jarabe/model/neighborhood.py
>> +++ b/src/jarabe/model/neighborhood.py
>> @@ -829,7 +829,7 @@ class Neighborhood(gobject.GObject):
>>
>>      def __buddy_updated_cb(self, account, contact_id, properties):
>>          logging.debug('__buddy_updated_cb %r', contact_id)
>> -        if contact_id not in self._buddies:
>> +        if contact_id is None or contact_id not in self._buddies:
>>              logging.debug('__buddy_updated_cb Unknown buddy with contact_id %r',
>>                            contact_id)
>>              return
>
>
> I guess this is the correct change, but we should note exactly when
> contact_id is None and why we simply ignore that case. At least to me
> it isn't obvious from the code. It feels strange to receive an "update"
> for Buddy <None>.

Agreed, the history behind is that we may get presence updates for
contacts from which we haven't gotten their contact-ids nor other info
yet. I have plans to fix it in tp-gabble because it also gives us an
opportunity for reducing the bandwidth used, but it will take a bit
more time.

I'm going to make it clearer in the code and repost the patch.

Regards,

Tomeu

> Sascha
>
> --
> http://sascha.silbe.org/
> http://www.infra-silbe.de/
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
>


More information about the Sugar-devel mailing list