From 518e9a70f554179f344510f594d7d759b56cea58 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Thu, 29 Jan 2015 16:24:44 +0000 Subject: fix for the automatic nick name extraction git-svn-id: http://svn.miranda-ng.org/main/trunk@11951 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 14 ++++++-------- 1 file changed, 6 insertions(+), 8 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++') diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index 9aa4450937..fcb659e97b 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -195,12 +195,8 @@ bool WAConnection::read() throw(WAException) if (node == NULL) return false; - #ifdef _DEBUG - { - string tmp = node->toString(); - rawConn->log(tmp.c_str()); - } - #endif + string tmp = node->toString(); + rawConn->log(tmp.c_str()); if (ProtocolTreeNode::tagEquals(node, "iq")) parseIq(node); @@ -307,6 +303,7 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio const string &id = messageNode->getAttributeValue("id"); const string &attribute_t = messageNode->getAttributeValue("t"); const string &from = messageNode->getAttributeValue("from"); + const string ¬ify = messageNode->getAttributeValue("notify"); const string &author = messageNode->getAttributeValue("author"); const string &typeAttribute = messageNode->getAttributeValue("type"); @@ -343,7 +340,7 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio if (receiptRequested) sendSubjectReceived(from, id); } - else if (typeAttribute == "chat" || typeAttribute == "text") { + else if (typeAttribute == "text") { FMessage fmessage; fmessage.wants_receipt = false; fmessage.timestamp = atoi(attribute_t.c_str()); @@ -354,7 +351,7 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio ProtocolTreeNode *childNode = messageChildren[i]; if (ProtocolTreeNode::tagEquals(childNode, "body")) { fmessage.key = Key(from, false, id); - fmessage.remote_resource = author; + fmessage.notifyname = notify; fmessage.data = childNode->getDataAsString(); fmessage.status = FMessage::STATUS_UNSENT; } @@ -395,6 +392,7 @@ void WAConnection::parseMessage(ProtocolTreeNode *messageNode) throw (WAExceptio } fmessage.key = Key(from, false, id); + fmessage.notifyname = notify; fmessage.remote_resource = author; } } -- cgit v1.2.3