~ubuntu-branches/ubuntu/quantal/telepathy-butterfly/quantal

« back to all changes in this revision

Viewing changes to butterfly/channel/media.py

  • Committer: Bazaar Package Importer
  • Author(s): Laurent Bigonville
  • Date: 2010-05-23 00:21:14 UTC
  • mfrom: (8.2.6 sid)
  • Revision ID: james.westby@ubuntu.com-20100523002114-m0invrm4uay9kpoy
Tags: 0.5.10-1
* New upstream release.
* Add debian/source/format file with version 1.0

Show diffs side-by-side

added added

removed removed

Lines of Context:
27
27
from butterfly.util.decorator import async
28
28
from butterfly.handle import ButterflyHandleFactory
29
29
from butterfly.media import ButterflySessionHandler
 
30
from butterfly.channel import ButterflyChannel
30
31
 
31
32
from telepathy.interfaces import CHANNEL_INTERFACE, CHANNEL_INTERFACE_GROUP,\
32
33
    CHANNEL_TYPE_STREAMED_MEDIA
38
39
 
39
40
 
40
41
class ButterflyMediaChannel(
 
42
        ButterflyChannel,
41
43
        telepathy.server.ChannelTypeStreamedMedia,
42
44
        telepathy.server.ChannelInterfaceCallState,
43
45
        telepathy.server.ChannelInterfaceGroup,
55
57
        papyon.event.CallEventInterface.__init__(self, call)
56
58
        papyon.event.ContactEventInterface.__init__(self, conn.msn_client)
57
59
        papyon.event.MediaSessionEventInterface.__init__(self, call.media_session)
 
60
        ButterflyChannel.__init__(self, conn, props)
58
61
 
59
62
        self._call = call
60
63
        self._handle = handle
61
64
 
62
 
        self._implement_property_get(CHANNEL_INTERFACE, {
63
 
                'InitiatorHandle': lambda: dbus.UInt32(self._initiator.id),
64
 
                'InitiatorID': lambda: self._initiator.name
65
 
                })
66
 
 
67
65
        self._implement_property_get(CHANNEL_INTERFACE_GROUP,
68
66
            {'LocalPendingMembers': lambda: self.GetLocalPendingMembersWithInfo() })
69
67
 
70
 
        self._add_immutables({
71
 
                'InitiatorHandle': CHANNEL_INTERFACE,
72
 
                'InitiatorID': CHANNEL_INTERFACE,
73
 
                })
74
 
 
75
 
        if CHANNEL_INTERFACE + '.InitiatorHandle' in props:
76
 
            self._initiator = conn.handle(telepathy.HANDLE_TYPE_CONTACT,
77
 
                props[CHANNEL_INTERFACE + '.InitiatorHandle'])
78
 
        elif CHANNEL_INTERFACE + '.InitiatorID' in props:
79
 
            self._initiator = ButterflyHandleFactory(conn, 'contact',
80
 
                id=props[CHANNEL_INTERFACE + '.InitiatorHandle'])
81
 
        else:
82
 
            logger.warning('InitiatorID or InitiatorHandle not set on new channel')
83
 
            self._initiator = None
84
 
 
85
68
        self._session_handler = ButterflySessionHandler(self._conn, self, call.media_session)
86
69
 
87
70
        flags = (telepathy.CHANNEL_GROUP_FLAG_CAN_REMOVE |