[Sugar-devel] [PATCH sugar] Set the nick name when the buddy properties changes OLPC #10750

Simon Schampijer simon at schampijer.de
Tue Jul 19 12:59:17 EDT 2011


On 07/18/2011 10:23 PM, Sascha Silbe wrote:
> Excerpts from Simon Schampijer's message of Mon Jul 18 19:51:16 +0200 2011:
>
>> We do get the correct nick information but we did not update
>> the buddy because of checking for a wrong property key. I checked
>> that in all the cases (alias-change or when we do get the buddy
>> information in various ways) the key is
>> "CONNECTION_INTERFACE_ALIASING + '/alias'".
>
> Acked-By: Sascha Silbe<silbe at activitycentral.com>
>
> [src/jarabe/model/neighborhood.py]
>> @@ -929,8 +929,9 @@ class Neighborhood(gobject.GObject):
>>           if 'key' in properties:
>>               buddy.props.key = properties['key']
>>
>> -        if 'nick' in properties:
>> -            buddy.props.nick = properties['nick']
>> +        nick_key = CONNECTION_INTERFACE_ALIASING + '/alias'
>> +        if nick_key in properties:
>> +            buddy.props.nick = properties[nick_key]
>
> How come only the nick name is prefixed by the interface name, but
> neither 'color' nor 'key'? Is it because they're custom Sugar
> properties? Should they also be prefixed by an interface name and we're
> doing something wrong elsewhere?

When the 'alias' changes [1] we actually do construct the property using 
the interface name ourself to match the other cases when the properties 
are updated [2][3].

The other keys like 'color or 'key' do come plain as well, the only 
other key which has a prefix is 'contact-id' which has the connection 
prefixed [4].

I don't think we do anything wrong here...

Regards,
    Simon

[1] http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe
/model/neighborhood.py#line387
[2] 
http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/model/neighborhood.py#line403
[3] 
http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/model/neighborhood.py#line546
[4] 
http://git.sugarlabs.org/sugar/mainline/blobs/master/src/jarabe/model/neighborhood.py#line570


More information about the Sugar-devel mailing list