From 88d6662a12f18844e5487c3d35155d3fbbff85a5 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Mon, 26 Jan 2015 23:21:25 +0000 Subject: fix for going offline in WhatsApp git-svn-id: http://svn.miranda-ng.org/main/trunk@11921 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp') diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 7ae18a30d5..1abcd431dd 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -278,7 +278,7 @@ void WAConnection::parseAck(ProtocolTreeNode *node) throw(WAException) const string &id = node->getAttributeValue("id"); const string &ts = node->getAttributeValue("t"); - if (this->event_handler != NULL) { + if (cls == "message" && this->event_handler != NULL) { FMessage msg(new Key(from, true, id)); msg.status = FMessage::STATUS_RECEIVED_BY_SERVER; this->event_handler->onMessageStatusUpdate(&msg); @@ -346,9 +346,10 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio if (receiptRequested) sendSubjectReceived(from, id); } - else if (typeAttribute == "chat") { + else if (typeAttribute == "chat" || typeAttribute == "text") { FMessage* fmessage = new FMessage(); fmessage->wants_receipt = false; + fmessage->timestamp = atoi(attribute_t.c_str()); bool duplicate = false; std::vector messageChildren(messageNode->getAllChildren()); -- cgit v1.2.3