[Sugar-devel] [PATCH sugar] Anly approve and not handle channels in the shell, part of OLPC #10738
David Van Assche
dvanassche at gmail.com
Thu Apr 14 19:22:38 EDT 2011
awsome stuff on all the telepathy related stuff... I'm no expert, but looks
like things became more homologised and is now used more in line with the
way empathy and others run under gnome to use telepathy... Maybe I'm reading
too much into this, but does this effectively mean that we can now
communicate with any telepathy based client on other systems from a sugar
based system?
Perhaps you could explain how this effects activity sharing across
activities on other oses (say chat client on gnome with sugar chat?)
kind regards,
David Van Assche
On Thu, Apr 14, 2011 at 7:42 PM, Simon Schampijer <simon at schampijer.de>wrote:
> 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.
>
> [1]
> http://telepathy.freedesktop.org/doc/book/sect.channel-dispatcher.clients.html
>
> Signed-off-by: Simon Schampijer <simon at laptop.org>
> ---
> src/jarabe/model/telepathyclient.py | 21 ++++++++++++++++-----
> 1 files changed, 16 insertions(+), 5 deletions(-)
>
> diff --git a/src/jarabe/model/telepathyclient.py
> b/src/jarabe/model/telepathyclient.py
> index c6fbac1..cea8693 100644
> --- a/src/jarabe/model/telepathyclient.py
> +++ b/src/jarabe/model/telepathyclient.py
> @@ -19,11 +19,16 @@ import logging
> import dbus
> from dbus import PROPERTIES_IFACE
> from telepathy.interfaces import CLIENT, \
> + CHANNEL, \
> + CHANNEL_TYPE_TEXT, \
> CLIENT_APPROVER, \
> CLIENT_HANDLER, \
> CLIENT_INTERFACE_REQUESTS
> from telepathy.server import DBusProperties
>
> +from telepathy.constants import CONNECTION_HANDLE_TYPE_CONTACT
> +from telepathy.constants import CONNECTION_HANDLE_TYPE_ROOM
> +
> from sugar import dispatch
>
>
> @@ -48,9 +53,6 @@ class TelepathyClient(dbus.service.Object,
> DBusProperties):
> self._implement_property_get(CLIENT, {
> 'Interfaces': lambda: list(self._interfaces),
> })
> - self._implement_property_get(CLIENT_HANDLER, {
> - 'HandlerChannelFilter': self.__get_filters_cb,
> - })
> self._implement_property_get(CLIENT_APPROVER, {
> 'ApproverChannelFilter': self.__get_filters_cb,
> })
> @@ -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
>
> @dbus.service.method(dbus_interface=CLIENT_HANDLER,
> in_signature='ooa(oa{sv})aota{sv}',
> out_signature='')
> --
> 1.7.4
>
> _______________________________________________
> Sugar-devel mailing list
> Sugar-devel at lists.sugarlabs.org
> http://lists.sugarlabs.org/listinfo/sugar-devel
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.sugarlabs.org/archive/sugar-devel/attachments/20110415/5e097eb7/attachment-0001.html>
More information about the Sugar-devel
mailing list