diff options
author | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-09-10 18:12:30 -0400 |
---|---|---|
committer | Louis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk> | 2010-09-10 18:12:30 -0400 |
commit | 65a00f77f4fed2535ff9b593d5f35ba413ef78a7 (patch) | |
tree | 8b24f59649c4292e62c03b3929c1ecdac5a6ec14 | |
parent | 0b69104b7f04a62cf3273c2b896fadb971c7b758 (diff) |
Send an error when a text message isn't delivered
-rw-r--r-- | butterfly/channel/text.py | 9 | ||||
-rwxr-xr-x | telepathy-butterfly | 4 |
2 files changed, 11 insertions, 2 deletions
diff --git a/butterfly/channel/text.py b/butterfly/channel/text.py index 75fd6b6..464d4e0 100644 --- a/butterfly/channel/text.py +++ b/butterfly/channel/text.py @@ -310,6 +310,15 @@ class ButterflyTextChannel( handle = self._get_handle(sender.account, sender.network_id) logger.info("User %s sent a nudge" % unicode(handle)) + # papyon.event.ConversationEventInterface + def on_conversation_error(self, error_type, error): + logger.warning("Conversation error %s %s" % (str(error_type), + str(error))) + if error_type == papyon.event.ConversationErrorType.MESSAGE: + timestamp = int(time.time()) + self.SendError(telepathy.CHANNEL_TEXT_SEND_ERROR_UNKNOWN, timestamp, + telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL, "") + @dbus.service.signal(telepathy.CHANNEL_INTERFACE_MESSAGES, signature='aa{sv}') def MessageReceived(self, message): id = message[0]['pending-message-id'] diff --git a/telepathy-butterfly b/telepathy-butterfly index 1917ccf..01bfecd 100755 --- a/telepathy-butterfly +++ b/telepathy-butterfly @@ -37,8 +37,8 @@ if telepathy.version < (0, 15, 17): sys.exit(1) import papyon -if papyon.version < (0, 5, 0): - print >> sys.stderr, 'Critical: papyon >= 0.5.0 required. Exiting.' +if papyon.version < (0, 5, 1): + print >> sys.stderr, 'Critical: papyon >= 0.5.1 required. Exiting.' sys.exit(1) |