Web   ·   Wiki   ·   Activities   ·   Blog   ·   Lists   ·   Chat   ·   Meeting   ·   Bugs   ·   Git   ·   Translate   ·   Archive   ·   People   ·   Donate
summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGuillaume Desmottes <guillaume.desmottes@collabora.co.uk>2008-05-14 12:52:29 (GMT)
committer Guillaume Desmottes <guillaume.desmottes@collabora.co.uk>2008-07-02 12:31:07 (GMT)
commitf6b139691fcdc46b363b910e7ac549dfc40d012e (patch)
treeba0da9d81bc20edb6a0c8a1b9fae1188d88c79de
parent69ffd6961bf76b36818f48e5cf68bc992e5499a6 (diff)
Add Activity.ListChannels() D-Bus method (import the patch attached to #4757)
-rw-r--r--src/activity.py36
1 files changed, 36 insertions, 0 deletions
diff --git a/src/activity.py b/src/activity.py
index ec20536..ae37011 100644
--- a/src/activity.py
+++ b/src/activity.py
@@ -583,6 +583,28 @@ class Activity(ExportedGObject):
return self.get_channels()
@dbus.service.method(_ACTIVITY_INTERFACE,
+ in_signature="", out_signature="soa(osuu)")
+ def ListChannels(self):
+ """D-Bus method to get the list of channels associated with this
+ activity.
+
+ :Returns:
+ - the D-Bus well-known service name of the connection
+ (FIXME: this is redundant; in Telepathy it can be derived
+ from that of the connection)
+ - the D-Bus object path of the connection
+ - a list of tuples containing for each channel associated
+ with this activity:
+ - a D-Bus object path for the channel object
+ - a D-Bus interface name representing the channel type
+ - an integer representing the handle type this channel
+ communicates with, or zero
+ - an integer handle representing the contact, room or
+ list this channel communicates with, or zero
+ """
+ return self.list_channels()
+
+ @dbus.service.method(_ACTIVITY_INTERFACE,
in_signature='a{sv}', out_signature='')
def SetProperties(self, new_props):
"""D-Bus method to update the activity's properties.
@@ -1017,6 +1039,20 @@ class Activity(ExportedGObject):
channels.append(self._tubes_channel.object_path)
return (str(conn.service_name), conn.object_path, channels)
+ def list_channels(self):
+ conn = self._tp.get_connection()
+ # XXX add other channels as necessary
+ channels = []
+ if self._text_channel is not None:
+ channels.append((self._text_channel.object_path,
+ CHANNEL_TYPE_TEXT, HANDLE_TYPE_ROOM, self._room))
+
+ if self._tubes_channel is not None:
+ channels.append((self._tubes_channel.object_path,
+ CHANNEL_TYPE_TUBES, HANDLE_TYPE_ROOM, self._room))
+
+ return (str(conn.service_name), conn.object_path, channels)
+
def leave(self, async_cb, async_err_cb):
"""Local method for the local user to leave the shared activity.