Starting to add access to the debug log
[theonering] / src / channel / call.py
index 1b89096..5808d4e 100644 (file)
@@ -16,7 +16,6 @@ class CallChannel(
                tp.ChannelInterfaceCallState,
                tp.ChannelInterfaceGroup,
        ):
-       # @bug On Maemo 5 this is having some kind of "General" error, possibly due to an issue with "GetAll" DBusProperties stuff
 
        def __init__(self, connection, manager, props, contactHandle):
                self.__manager = manager
@@ -34,8 +33,13 @@ class CallChannel(
                                props[telepathy.interfaces.CHANNEL_INTERFACE + '.InitiatorHandle'],
                        )
                else:
-                       _moduleLogger.warning('InitiatorID or InitiatorHandle not set on new channel')
-                       self._initiator = None
+                       # Maemo 5 seems to require InitiatorHandle/InitiatorID to be set
+                       # even though I can't find them in the dbus spec.  I think its
+                       # generally safe to assume that its locally initiated if not
+                       # specified.  Specially for The One Ring, its always locally
+                       # initiated
+                       _moduleLogger.warning('InitiatorID or InitiatorHandle not set on new channel, assuming locally initiated')
+                       self._initiator = connection.GetSelfHandle()
 
                tp.ChannelTypeStreamedMedia.__init__(self, connection, manager, props)
                tp.ChannelInterfaceCallState.__init__(self)
@@ -48,6 +52,10 @@ class CallChannel(
                                "InitialVideo": self.initial_video,
                        },
                )
+               self._add_immutables({
+                       'InitialAudio': telepathy.interfaces.CHANNEL_TYPE_STREAMED_MEDIA,
+                       'InitialVideo': telepathy.interfaces.CHANNEL_TYPE_STREAMED_MEDIA,
+               })
                self._implement_property_get(
                        telepathy.interfaces.CHANNEL_INTERFACE,
                        {
@@ -55,6 +63,10 @@ class CallChannel(
                                'InitiatorID': lambda: self._initiator.name,
                        },
                )
+               self._add_immutables({
+                       'InitiatorHandle': telepathy.interfaces.CHANNEL_INTERFACE,
+                       'InitiatorID': telepathy.interfaces.CHANNEL_INTERFACE,
+               })
 
                self.GroupFlagsChanged(0, 0)
                self.MembersChanged(
@@ -124,7 +136,7 @@ class CallChannel(
                self._conn.session.backend.call(contactNumber)
 
                streamId = 0
-               streamState = telepathy.constants.MEDIA_STREAM_STATE_DISCONNECTED
+               streamState = telepathy.constants.MEDIA_STREAM_STATE_CONNECTED
                streamDirection = telepathy.constants.MEDIA_STREAM_DIRECTION_BIDIRECTIONAL
                pendingSendFlags = telepathy.constants.MEDIA_STREAM_PENDING_REMOTE_SEND
                return [(streamId, contact, streamTypes[0], streamState, streamDirection, pendingSendFlags)]