[telepathy-butterfly/master] Fix sending non-ascii offline messages (fd.o #24725)

Olivier Le Thanh Duong olivier at lethanh.be
Sun Oct 25 10:46:36 PDT 2009


---
 NEWS                      |    1 +
 butterfly/channel/text.py |    2 +-
 2 files changed, 2 insertions(+), 1 deletions(-)

diff --git a/NEWS b/NEWS
index d91c686..f74116f 100644
--- a/NEWS
+++ b/NEWS
@@ -6,6 +6,7 @@ Dependencies:
 Enhancements:
 
 Fixes:
+  * Fix sending non-ascii offline messages (fd.o #24725)
 
 telepathy-butterfly-0.5.2 (20-10-2009)
 ======================================
diff --git a/butterfly/channel/text.py b/butterfly/channel/text.py
index c53786c..d9dcfc4 100644
--- a/butterfly/channel/text.py
+++ b/butterfly/channel/text.py
@@ -101,7 +101,7 @@ class ButterflyTextChannel(
         else:
             if message_type == telepathy.CHANNEL_TEXT_MESSAGE_TYPE_NORMAL:
                 logger.info("Sending offline message : %s" % unicode(text))
-                self._oim_box_ref().send_message(self._offline_contact, text)
+                self._oim_box_ref().send_message(self._offline_contact, text.encode("utf-8"))
                 #FIXME : Check if the message was sent correctly?
             else:
                 raise telepathy.NotImplemented("Unhandled message type for offline contact")
-- 
1.5.6.5



More information about the telepathy-commits mailing list