+class Call(Action):
+
+ def __init__(self, connAction, chanAction, handleAction):
+ super(Call, self).__init__()
+ self._connAction = connAction
+ self._chanAction = chanAction
+ self._handleAction = handleAction
+
+ def queue_action(self):
+ self._chanAction.channel[telepathy.server.CHANNEL_TYPE_STREAMED_MEDIA].RequestStreams(
+ self._handleAction.handle,
+ [telepathy.constants.MEDIA_STREAM_TYPE_AUDIO],
+ reply_handler = self._on_done,
+ error_handler = self._on_error,
+ )
+
+ def _on_done(self, handle):
+ print "Call started"
+ super(Call, self)._on_done()
+
+
+class SendText(Action):
+
+ def __init__(self, connAction, chanAction, handleAction, messageType, message):
+ super(SendText, self).__init__()
+ self._connAction = connAction
+ self._chanAction = chanAction
+ self._handleAction = handleAction
+ self._messageType = messageType
+ self._message = message
+
+ def queue_action(self):
+ self._chanAction.channel[telepathy.server.CHANNEL_TYPE_TEXT].Send(
+ self._messageType,
+ self._message,
+ reply_handler = self._on_done,
+ error_handler = self._on_error,
+ )
+
+ def _on_done(self,):
+ print "Message sent"
+ super(SendText, self)._on_done()
+
+
+class Sleep(Action):
+
+ def __init__(self, length):
+ super(Sleep, self).__init__()
+ self._length = length
+
+ def queue_action(self):
+ gobject.timeout_add(self._length, self._on_done)
+
+
+class Block(Action):
+
+ def __init__(self):
+ super(Block, self).__init__()
+
+ def queue_action(self):
+ print "Blocking"
+
+ def _on_done(self):
+ #super(SendText, self)._on_done()
+ pass
+
+