From e3506fe66886912cee16a91793d17010a87eecef Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 10 Feb 2015 21:27:38 +0000 Subject: various rudiments & atavisms exterminated git-svn-id: http://svn.miranda-ng.org/main/trunk@12085 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 21 +++++---------------- 1 file changed, 5 insertions(+), 16 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 1d5e59b00e..6052c768bc 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -115,7 +115,6 @@ WAConnection::WAConnection(const std::string &user, const std::string &resource, this->supports_receipt_acks = false; this->iqid = 0; - this->verbose = true; this->lastTreeRead = 0; this->expire_date = 0L; this->account_kind = -1; @@ -135,14 +134,7 @@ std::string WAConnection::gidToGjid(const std::string &gid) std::string WAConnection::makeId(const std::string &prefix) { - this->iqid++; - std::string id; - if (this->verbose) - id = prefix + Utilities::intToStr(this->iqid); - else - id = Utilities::itoa(this->iqid, 16); - - return id; + return prefix + Utilities::itoa(++this->iqid, 16); } ProtocolTreeNode* WAConnection::getReceiptAck(const std::string &to, const std::string &id, const std::string &receiptType) throw(WAException) @@ -176,11 +168,6 @@ void WAConnection::setLogin(WALogin* login) this->account_kind = login->m_iAccountKind; } -void WAConnection::setVerboseId(bool b) -{ - this->verbose = b; -} - bool WAConnection::read() throw(WAException) { ProtocolTreeNode *node; @@ -843,11 +830,13 @@ void WAConnection::sendPresenceSubscriptionRequest(const std::string &to) throw( void WAConnection::sendQueryLastOnline(const std::string &jid) throw (WAException) { + if (jid == "Server@s.whatsapp.net") // to avoid error 405 + return; + std::string id = makeId("iq_"); this->pending_server_requests[id] = new IqResultQueryLastOnlineHandler(this); - ProtocolTreeNode *queryNode = new ProtocolTreeNode("query"); - out.write(ProtocolTreeNode("iq", queryNode) + out.write(ProtocolTreeNode("iq", new ProtocolTreeNode("query")) << XATTR("id", id) << XATTR("type", "get") << XATTR("to", jid) << XATTR("xmlns", "jabber:iq:last")); } -- cgit v1.2.3