Exemplo n.º 1
0
    def __init__(self, conn, manager, conversation, props, object_path=None):
        self._recv_id = 0
        self._conn_ref = weakref.ref(conn)
        self._send_typing_notification_timeout = 0
        self._typing_notifications = dict()

        self._conversation = None
        self._pending_messages2 = {}

        telepathy.server.ChannelTypeText.__init__(self, conn, manager, props, object_path=object_path)
        ButterflyChannel.__init__(self, conn, props)
        telepathy.server.ChannelInterfaceChatState.__init__(self)
        ChannelInterfaceMessages.__init__(self)
        papyon.event.ContactEventInterface.__init__(self, conn.msn_client)

        self._implement_property_get(
            CHANNEL_INTERFACE_MESSAGES,
            {
                "SupportedContentTypes": lambda: ["text/plain"],
                "MessagePartSupportFlags": lambda: 0,
                "DeliveryReportingSupport": lambda: telepathy.DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES,
                "PendingMessages": lambda: dbus.Array(self._pending_messages2.values(), signature="aa{sv}"),
            },
        )

        self._add_immutables(
            {
                "SupportedContentTypes": CHANNEL_INTERFACE_MESSAGES,
                "MessagePartSupportFlags": CHANNEL_INTERFACE_MESSAGES,
                "DeliveryReportingSupport": CHANNEL_INTERFACE_MESSAGES,
            }
        )
    def __init__(self, conn, manager, call, handle, props, object_path=None):
        telepathy.server.ChannelTypeStreamedMedia.__init__(
            self, conn, manager, props, object_path=object_path)
        telepathy.server.ChannelInterfaceCallState.__init__(self)
        telepathy.server.ChannelInterfaceGroup.__init__(self)
        telepathy.server.ChannelInterfaceMediaSignalling.__init__(self)
        papyon.event.CallEventInterface.__init__(self, call)
        papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
        ButterflyChannel.__init__(self, conn, props)

        self._call = call
        self._handle = handle

        self._implement_property_get(CHANNEL_INTERFACE_GROUP, {
            'LocalPendingMembers':
            lambda: self.GetLocalPendingMembersWithInfo()
        })

        self._session_handler = ButterflySessionHandler(
            self._conn, self, call.media_session)

        flags = (telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE
                 | telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REMOVE
                 | telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REJECT)
        self.GroupFlagsChanged(flags, 0)
        self.__add_initial_participants()

        types = []
        initial_audio_prop = CHANNEL_TYPE_STREAMED_MEDIA + '.InitialAudio'
        initial_video_prop = CHANNEL_TYPE_STREAMED_MEDIA + '.InitialVideo'
        self._add_immutables({
            'InitialAudio': CHANNEL_TYPE_STREAMED_MEDIA,
            'InitialVideo': CHANNEL_TYPE_STREAMED_MEDIA,
        })

        self._initial_video = False
        self._initial_audio = False

        if props.get(initial_audio_prop, False):
            types.append(MEDIA_STREAM_TYPE_AUDIO)
            self._initial_audio = True
        if props.get(initial_video_prop, False):
            types.append(MEDIA_STREAM_TYPE_VIDEO)
            self._initial_video = True

        self._implement_property_get(
            CHANNEL_TYPE_STREAMED_MEDIA, {
                'InitialAudio': lambda: dbus.Boolean(self._initial_audio),
                'InitialVideo': lambda: dbus.Boolean(self._initial_video),
            })

        if types:
            self.RequestStreams(handle, types)

        for stream in call.media_session._streams:
            self.on_stream_created(stream)
        for stream in call.media_session.streams:
            self.on_stream_added(stream)
        papyon.event.MediaSessionEventInterface.__init__(
            self, call.media_session)
Exemplo n.º 3
0
 def __init__(self, connection, manager, props, object_path=None):
     self._conn_ref = weakref.ref(connection)
     telepathy.server.ChannelTypeContactList.__init__(self, connection, manager, props,
         object_path=object_path)
     ButterflyChannel.__init__(self, connection, props)
     telepathy.server.ChannelInterfaceGroup.__init__(self)
     papyon.event.AddressBookEventInterface.__init__(self, connection.msn_client)
     self._populate(connection)
 def __init__(self, connection, manager, props, object_path=None):
     self._conn_ref = weakref.ref(connection)
     telepathy.server.ChannelTypeContactList.__init__(
         self, connection, manager, props, object_path=object_path)
     ButterflyChannel.__init__(self, connection, props)
     telepathy.server.ChannelInterfaceGroup.__init__(self)
     papyon.event.AddressBookEventInterface.__init__(
         self, connection.msn_client)
     self._populate(connection)
Exemplo n.º 5
0
    def __init__(self, conn, manager, call, handle, props, object_path=None):
        telepathy.server.ChannelTypeStreamedMedia.__init__(self, conn, manager, props,
            object_path=object_path)
        telepathy.server.ChannelInterfaceCallState.__init__(self)
        telepathy.server.ChannelInterfaceGroup.__init__(self)
        telepathy.server.ChannelInterfaceMediaSignalling.__init__(self)
        papyon.event.CallEventInterface.__init__(self, call)
        papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
        ButterflyChannel.__init__(self, conn, props)

        self._call = call
        self._handle = handle

        self._implement_property_get(CHANNEL_INTERFACE_GROUP,
            {'LocalPendingMembers': lambda: self.GetLocalPendingMembersWithInfo() })

        self._session_handler = ButterflySessionHandler(self._conn, self, call.media_session)

        flags = (telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE |
                 telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REMOVE |
                 telepathy.CHANNEL_GROUP_FLAG_MESSAGE_REJECT)
        self.GroupFlagsChanged(flags, 0)
        self.__add_initial_participants()

        types = []
        initial_audio_prop = CHANNEL_TYPE_STREAMED_MEDIA + '.InitialAudio'
        initial_video_prop = CHANNEL_TYPE_STREAMED_MEDIA + '.InitialVideo'
        self._add_immutables({
                'InitialAudio': CHANNEL_TYPE_STREAMED_MEDIA,
                'InitialVideo': CHANNEL_TYPE_STREAMED_MEDIA,
                })

        self._initial_video = False
        self._initial_audio = False

        if props.get(initial_audio_prop, False):
            types.append(MEDIA_STREAM_TYPE_AUDIO)
            self._initial_audio = True
        if props.get(initial_video_prop, False):
            types.append(MEDIA_STREAM_TYPE_VIDEO)
            self._initial_video = True

        self._implement_property_get(CHANNEL_TYPE_STREAMED_MEDIA, {
                'InitialAudio': lambda: dbus.Boolean(self._initial_audio),
                'InitialVideo': lambda: dbus.Boolean(self._initial_video),
                })

        if types:
            self.RequestStreams(handle, types)

        for stream in call.media_session._streams:
            self.on_stream_created(stream)
        for stream in call.media_session.streams:
            self.on_stream_added(stream)
        papyon.event.MediaSessionEventInterface.__init__(self, call.media_session)
Exemplo n.º 6
0
    def __init__(self, conn, manager, conversation, props, object_path=None):
        self._recv_id = 0
        self._conn_ref = weakref.ref(conn)
        self._send_typing_notification_timeout = 0
        self._typing_notifications = dict()

        self._conversation = None
        self._pending_messages2 = {}

        telepathy.server.ChannelTypeText.__init__(self,
                                                  conn,
                                                  manager,
                                                  props,
                                                  object_path=object_path)
        ButterflyChannel.__init__(self, conn, props)
        telepathy.server.ChannelInterfaceChatState.__init__(self)
        ChannelInterfaceMessages.__init__(self)
        papyon.event.ContactEventInterface.__init__(self, conn.msn_client)

        self._implement_property_get(
            CHANNEL_INTERFACE_MESSAGES, {
                'SupportedContentTypes':
                lambda: ["text/plain"],
                'MessagePartSupportFlags':
                lambda: 0,
                'DeliveryReportingSupport':
                lambda: telepathy.
                DELIVERY_REPORTING_SUPPORT_FLAG_RECEIVE_FAILURES,
                'PendingMessages':
                lambda: dbus.Array(self._pending_messages2.values(),
                                   signature='aa{sv}')
            })

        self._add_immutables({
            'SupportedContentTypes':
            CHANNEL_INTERFACE_MESSAGES,
            'MessagePartSupportFlags':
            CHANNEL_INTERFACE_MESSAGES,
            'DeliveryReportingSupport':
            CHANNEL_INTERFACE_MESSAGES,
        })