[Sugar-devel] [PATCH sugar] Only approve and not handle channels in the shell, part of OLPC #10738
Simon Schampijer
simon at schampijer.de
Mon May 23 07:21:19 EDT 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 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
---
src/jarabe/model/telepathyclient.py | 21 +++++++++++++++------
1 files changed, 15 insertions(+), 6 deletions(-)
diff --git a/src/jarabe/model/telepathyclient.py b/src/jarabe/model/telepathyclient.py
index c6fbac1..3a60866 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,
})
@@ -59,9 +61,16 @@ class TelepathyClient(dbus.service.Object, DBusProperties):
self.got_dispatch_operation = dispatch.Signal()
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
More information about the Sugar-devel
mailing list