summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:12:30 -0400
committerLouis-Francis Ratté-Boulianne <louis-francis.ratte-boulianne@collabora.co.uk>2010-09-10 18:12:30 -0400
commit65a00f77f4fed2535ff9b593d5f35ba413ef78a7 (patch)
tree8b24f59649c4292e62c03b3929c1ecdac5a6ec14
parent0b69104b7f04a62cf3273c2b896fadb971c7b758 (diff)
Send an error when a text message isn't delivered
-rw-r--r--butterfly/channel/text.py9
-rwxr-xr-xtelepathy-butterfly4
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)