summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-02-10 21:27:38 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-02-10 21:27:38 +0000
commite3506fe66886912cee16a91793d17010a87eecef (patch)
treeb06ba97cf876baa40ca4ed1bda85f9e932e435f9 /protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
parent327745289de431e7e7dad6e4ce0eb8cef43eaeb5 (diff)
various rudiments & atavisms exterminated
git-svn-id: http://svn.miranda-ng.org/main/trunk@12085 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp21
1 files changed, 5 insertions, 16 deletions
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"));
}