From 06ca08ab518ba90cc82db8cc9ac27b5a25340510 Mon Sep 17 00:00:00 2001 From: Tobias Weimer Date: Mon, 21 Sep 2015 19:06:14 +0000 Subject: WhatsApp: - Request password with Voice (patch by Cassio) - minor fixes git-svn-id: http://svn.miranda-ng.org/main/trunk@15418 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) (limited to 'protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp') diff --git a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp index 5184dab86e..efcb9551fb 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WALogin.cpp @@ -108,9 +108,8 @@ std::vector WALogin::readFeaturesUntilChallengeOrSuccess() if (ProtocolTreeNode::tagEquals(root, "stream:features")) { m_pConnection->supports_receipt_acks = root->getChild("receipt_acks") != NULL; delete root; - continue; } - if (ProtocolTreeNode::tagEquals(root, "challenge")) { + else if (ProtocolTreeNode::tagEquals(root, "challenge")) { std::vector challengedata(root->data->begin(), root->data->end()); delete root; this->sendResponse(challengedata); @@ -119,12 +118,14 @@ std::vector WALogin::readFeaturesUntilChallengeOrSuccess() m_pConnection->logData("Read success"); return std::vector(data.begin(), data.end()); } - if (ProtocolTreeNode::tagEquals(root, "success")) { + else if (ProtocolTreeNode::tagEquals(root, "success")) { std::vector ret(root->data->begin(), root->data->end()); this->parseSuccessNode(root); delete root; return ret; } + else + delete root; } throw WAException("fell out of loop in readFeaturesAndChallenge", WAException::CORRUPT_STREAM_EX, 0); } -- cgit v1.2.3