Hoping to get calls working on Maemo 5 by adding these undocumented attributes that...
authorEd Page <eopage@byu.net>
Fri, 22 Jan 2010 04:03:21 +0000 (22:03 -0600)
committerEd Page <eopage@byu.net>
Fri, 22 Jan 2010 04:03:21 +0000 (22:03 -0600)
src/channel/call.py

index 7e185fe..1b89096 100644 (file)
@@ -1,5 +1,6 @@
 import logging
 
+import dbus
 import gobject
 import telepathy
 
@@ -22,6 +23,20 @@ class CallChannel(
                self.__props = props
                self.__cancelId = None
 
+               if telepathy.interfaces.CHANNEL_INTERFACE + '.InitiatorHandle' in props:
+                       self._initiator = connection.get_handle_by_id(
+                               telepathy.HANDLE_TYPE_CONTACT,
+                               props[telepathy.interfaces.CHANNEL_INTERFACE + '.InitiatorHandle'],
+                       )
+               elif telepathy.interfaces.CHANNEL_INTERFACE + '.InitiatorID' in props:
+                       self._initiator = connection.get_handle_by_name(
+                               telepathy.HANDLE_TYPE_CONTACT,
+                               props[telepathy.interfaces.CHANNEL_INTERFACE + '.InitiatorHandle'],
+                       )
+               else:
+                       _moduleLogger.warning('InitiatorID or InitiatorHandle not set on new channel')
+                       self._initiator = None
+
                tp.ChannelTypeStreamedMedia.__init__(self, connection, manager, props)
                tp.ChannelInterfaceCallState.__init__(self)
                tp.ChannelInterfaceGroup.__init__(self)
@@ -33,6 +48,13 @@ class CallChannel(
                                "InitialVideo": self.initial_video,
                        },
                )
+               self._implement_property_get(
+                       telepathy.interfaces.CHANNEL_INTERFACE,
+                       {
+                               'InitiatorHandle': lambda: dbus.UInt32(self._initiator.id),
+                               'InitiatorID': lambda: self._initiator.name,
+                       },
+               )
 
                self.GroupFlagsChanged(0, 0)
                self.MembersChanged(
@@ -59,6 +81,10 @@ class CallChannel(
                        self.__cancelId = None
 
        @gtk_toolbox.log_exception(_moduleLogger)
+       def GetLocalPendingMembersWithInfo(self):
+               return []
+
+       @gtk_toolbox.log_exception(_moduleLogger)
        def ListStreams(self):
                """
                For org.freedesktop.Telepathy.Channel.Type.StreamedMedia