diff options
author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-09-10 18:17:00 -0400 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-09-10 18:17:00 -0400 |
commit | 4cc71f2ab8df1a80a8fb7fdcfd650afd4ab6f0d6 (patch) | |
tree | 11e6c19d7055b8014ac60b3419333b8f97e65328 | |
parent | 7d523265a0d5d066356ff7285f69f14f6cbc2698 (diff) |
Clear the conversation when it's closed
-rw-r--r-- | butterfly/channel/im.py | 9 |
1 files changed, 8 insertions, 1 deletions
diff --git a/butterfly/channel/im.py b/butterfly/channel/im.py index d2366d4..696d99d 100644 --- a/butterfly/channel/im.py +++ b/butterfly/channel/im.py @@ -157,13 +157,20 @@ class ButterflyImChannel(ButterflyTextChannel): logger.info('Created new MUC channel to replace this 1-1 one: %s' % \ new_channel._object_path) + # papyon.event.ConversationEventInterface + def on_conversation_closed(self): + logger.info('Conversation closed') + self._offline_contact = self._initial_handle.contact + self._offline_handle = self._initial_handle + self._conversation = None + # papyon.event.ContactEventInterface def on_contact_presence_changed(self, contact): handle = ButterflyHandleFactory(self._conn_ref(), 'contact', contact.account, contact.network_id) # Recreate a conversation if our contact join if self._offline_contact == contact and contact.presence != papyon.Presence.OFFLINE: - logger.info('Contact %s connected, inviting him to the text channel' % unicode(contact)) + logger.info('Contact %s connected, inviting him to the text channel' % unicode(handle)) client = self._conn_ref().msn_client self._conversation = papyon.Conversation(client, [contact]) papyon.event.ConversationEventInterface.__init__(self, self._conversation) |