class CallChannel(
tp.ChannelTypeStreamedMedia,
- tp.ChannelInterfaceCallState,
tp.ChannelInterfaceGroup,
+ tp.ChannelInterfaceCallState,
+ tp.ChannelInterfaceHold,
):
def __init__(self, connection, manager, props, contactHandle):
self._initiator = connection.GetSelfHandle()
tp.ChannelTypeStreamedMedia.__init__(self, connection, manager, props)
- tp.ChannelInterfaceCallState.__init__(self)
tp.ChannelInterfaceGroup.__init__(self)
+ tp.ChannelInterfaceCallState.__init__(self)
+ tp.ChannelInterfaceHold.__init__(self)
self.__contactHandle = contactHandle
self.__calledNumer = None
})
self.GroupFlagsChanged(0, 0)
+ added, removed = [self._conn.GetSelfHandle()], []
+ localPending, remotePending = [], [contactHandle]
self.MembersChanged(
- '', [self._conn.GetSelfHandle()], [], [], [contactHandle],
+ '', added, removed, localPending, remotePending,
0, telepathy.CHANNEL_GROUP_CHANGE_REASON_NONE
)
self.__calledNumer = contactNumber
self.CallStateChanged(self.__contactHandle, telepathy.constants.CHANNEL_CALL_STATE_RINGING)
self._conn.session.backend.call(contactNumber)
- self._delayedClose.start(seconds=5)
+ self._delayedClose.start(seconds=0)
self.CallStateChanged(self.__contactHandle, telepathy.constants.CHANNEL_CALL_STATE_FORWARDED)
streamId = 0
return {self.__contactHandle: telepathy.constants.CHANNEL_CALL_STATE_FORWARDED}
@misc_utils.log_exception(_moduleLogger)
+ def GetHoldState(self):
+ """
+ For org.freedesktop.Telepathy.Channel.Interface.Hold
+
+ Get the current hold state
+ @returns (HoldState, Reason)
+ """
+ return (
+ telepathy.constants.LOCAL_HOLD_STATE_UNHELD,
+ telepathy.constants.LOCAL_HOLD_STATE_REASON_NONE,
+ )
+
+ @misc_utils.log_exception(_moduleLogger)
+ def RequestHold(self, Hold):
+ """
+ For org.freedesktop.Telepathy.Channel.Interface.Hold
+ """
+ if not Hold:
+ return
+ _moduleLogger.debug("Closing without cancel to get out of users way")
+ self.__calledNumer = None
+ self.close()
+
+ @misc_utils.log_exception(_moduleLogger)
def _on_close_requested(self, *args):
_moduleLogger.debug("Cancel now disallowed")
self.__calledNumer = None