~ubuntu-branches/ubuntu/lucid/telepathy-butterfly/lucid-proposed

« back to all changes in this revision

Viewing changes to butterfly/channel/text.py

  • Committer: Bazaar Package Importer
  • Author(s): Sebastien Bacher
  • Date: 2010-03-12 00:46:18 UTC
  • mfrom: (1.1.13 upstream)
  • Revision ID: james.westby@ubuntu.com-20100312004618-0kefsdvu69u3khh0
Tags: 0.5.5-0ubuntu1
* New upstream version:
  This release disables audio/video calls, 
  which have been broken since Microsoft removed the necessary servers.
  Enhancements:
  - Updated to the new MailNotification spec
  - Attach new conversation to existing channel 
  - Use prettier object path for channel 
  Fixes:
  - Desactive A/V call 
  - capabilities: fix typo 
  Dependencies :
  - telepathy-python 0.15.16
* debian/control:
  - updated telepathy-python depends

Show diffs side-by-side

added added

removed removed

Lines of Context:
40
40
        papyon.event.ContactEventInterface,
41
41
        papyon.event.ConversationEventInterface):
42
42
 
43
 
    def __init__(self, conn, manager, conversation, props):
 
43
    def __init__(self, conn, manager, conversation, props, object_path=None):
44
44
        _, surpress_handler, handle = manager._get_type_requested_handle(props)
45
45
        self._recv_id = 0
46
46
        self._conn_ref = weakref.ref(conn)
60
60
            self._offline_handle = handle
61
61
            self._offline_contact = contact
62
62
 
63
 
        telepathy.server.ChannelTypeText.__init__(self, conn, manager, props)
 
63
        telepathy.server.ChannelTypeText.__init__(self, conn, manager, props,
 
64
            object_path=object_path)
64
65
        telepathy.server.ChannelInterfaceGroup.__init__(self)
65
66
        telepathy.server.ChannelInterfaceChatState.__init__(self)
66
67
        papyon.event.ConversationEventInterface.__init__(self, conn.msn_client)
137
138
            self._oim_box_ref().delete_messages(messages)
138
139
        return telepathy.server.ChannelTypeText.ListPendingMessages(self, clear)
139
140
 
 
141
    # Group interface, only removing ourself is supported
 
142
    def RemoveMembers(self, contacts, message):
 
143
        if int(self.GetSelfHandle()) in contacts:
 
144
            print "close channel"
 
145
            self.Close()
 
146
        else :
 
147
            raise telepathy.PermissionDenied
 
148
 
140
149
    # papyon.event.ConversationEventInterface
141
150
    def on_conversation_user_joined(self, contact):
142
151
        handle = ButterflyHandleFactory(self._conn_ref(), 'contact',
235
244
 
236
245
        self._recv_id += 1
237
246
 
 
247
    def attach_conversation(self, conversation):
 
248
        # @conversation a papyon.ConversationInterface
 
249
        if self._conversation:
 
250
            if self._conversation is conversation:
 
251
                logger.warning("Trying to reattach the same switchboard to a channel, do nothing")
 
252
                return
 
253
            else:
 
254
                logger.warning("Attaching to a channel which already have a switchboard, leaving previous one")
 
255
                self._conversation.leave()
 
256
        else:
 
257
            self._offline_contact = None
 
258
            self._offline_handle = None
 
259
        self._conversation = conversation
 
260
        papyon.event.ConversationEventInterface.__init__(self, self._conversation)
 
261
 
238
262
    @async
239
263
    def __add_initial_participants(self):
240
264
        handles = []