f3aaef538a5e447b80462bba9176115820f860e3
[theonering] / src / channel / call.py
1 import weakref
2 import logging
3
4 import telepathy
5
6
7 class CallChannel(
8                 telepathy.server.ChannelTypeStreamedMedia,
9                 telepathy.server.ChannelInterfaceCallState,
10         ):
11
12         def __init__(self, connection, conversation):
13                 self._recv_id = 0
14                 self._conversation = conversation
15                 self._connRef = weakref.ref(connection)
16
17                 telepathy.server.ChannelTypeText.__init__(self, connection, None)
18                 telepathy.server.ChannelInterfaceGroup.__init__(self)
19                 telepathy.server.ChannelInterfaceChatState.__init__(self)
20
21                 self.GroupFlagsChanged(telepathy.CHANNEL_GROUP_FLAG_CAN_ADD, 0)
22                 self.__add_initial_participants()
23
24         def ListStreams(self):
25                 """
26                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
27                 """
28                 pass
29
30         def RemoveStreams(self, streams):
31                 """
32                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
33                 """
34                 pass
35
36         def RequestStreamDirection(self, stream, streamDirection):
37                 """
38                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
39
40                 @note Since streams are short lived, not bothering to implement this
41                 """
42                 logging.info("A request was made to change the stream direction")
43
44         def RequestStreams(self, contact, streamType):
45                 """
46                 For org.freedesktop.Telepathy.Channel.Type.StreamedMedia
47
48                 @returns [(Stream ID, contact, stream type, stream state, stream direction, pending send flags)]
49                 """
50                 pass
51
52         def GetCallStates(self):
53                 """
54                 For org.freedesktop.Telepathy.Channel.Interface.CallState
55
56                 Get the current call states for all contacts involved in this call. 
57                 @returns {Contact: telepathy.constants.CHANNEL_CALL_STATE_*}
58                 """
59                 pass