[Sugar-devel] [PATCH sugar] Anly approve and not handle channels in the shell, part of OLPC #10738

Simon Schampijer simon at schampijer.de
Thu Apr 28 10:58:44 EDT 2011


On 04/15/2011 06:47 PM, Sascha Silbe wrote:
> Excerpts from Simon Schampijer's message of Thu Apr 14 19:42:05 +0200 2011:
>> We only approve channels in the shell and do not claim to handle them
>> anymore. The handling is now done by the activity (toolkit patch).
>> More info about approving and handling of channels can be found at [1].
>>
>
>> This patch does as well only handle sugar activity invitations, invitations
>> from non-sugar clients will be handled in a separate patch.
>
> s/as well // ?

Yes.

> [src/jarabe/model/telepathyclient.py]
>> @@ -60,8 +62,17 @@ class TelepathyClient(dbus.service.Object, DBusProperties):
>>
>>       def __get_filters_cb(self):
>>           logging.debug('__get_filters_cb')
>> -        filter_dict = dbus.Dictionary({}, signature='sv')
>> -        return dbus.Array([filter_dict], signature='a{sv}')
>> +
>> +        filt = {
>> +            CHANNEL + '.ChannelType': CHANNEL_TYPE_TEXT,
>> +            CHANNEL + '.TargetHandleType': CONNECTION_HANDLE_TYPE_ROOM,
>> +            }
>> +        filter_dict = dbus.Dictionary(filt, signature='sv')
>> +        filters = dbus.Array([filter_dict], signature='a{sv}')
>> +
>> +        logging.debug('__get_filters_cb %r', filters)
>> +
>> +        return filters
>
> Given that "filt" is non-empty, do we really need the explicit
> conversions? I.e. would the following work?
>
>      def __get_filters_cb(self):
>          logging.debug('__get_filters_cb')
>          return [{
>              CHANNEL + '.ChannelType': CHANNEL_TYPE_TEXT,
>              CHANNEL + '.TargetHandleType': CONNECTION_HANDLE_TYPE_ROOM,
>              }]
>
> (The content seems to be static, so it wouldn't make sense to log it.)

Ok, the logging can go away.

> The general approach looks fine. With or without the above changes, but
> after you got Samuels Tested-By:

Sam, did you test this already?

Regards,
    Simon


More information about the Sugar-devel mailing list