From d54cdd00ee33cabf176d6124cb107e13e46701a0 Mon Sep 17 00:00:00 2001 From: CODeRUS Date: Mon, 3 Dec 2012 03:06:10 +0600 Subject: [PATCH] Resending old messages fix --- src/client/waxmpp.py | 15 ++++++++++----- 1 file changed, 10 insertions(+), 5 deletions(-) diff --git a/src/client/waxmpp.py b/src/client/waxmpp.py index 7d6b5d2e..7fc954c6 100755 --- a/src/client/waxmpp.py +++ b/src/client/waxmpp.py @@ -347,11 +347,16 @@ def resendUnsent(self): media.save() else: try: - msgId = self.interfaceHandler.call("message_send", (jid, m.content.encode('utf-8'))) - m.key = Key(jid, True, msgId).toString() - m.save() - except UnicodeDecodeError: - self._d("skipped sending an old message because UnicodeDecodeError") + try: + msgId = self.interfaceHandler.call("message_send", (jid, m.content.encode('utf-8'))) #maybe useless now? + m.key = Key(jid, True, msgId).toString() + m.save() + except UnicodeDecodeError: + msgId = self.interfaceHandler.call("message_send", (jid, m.content)) + m.key = Key(jid, True, msgId).toString() + m.save() + except: + self._d("skipped sending an old message because of i don't know why!") self._d("Resending old messages done")