summaryrefslogtreecommitdiff
path: root/protocols/WhatsApp/src/WhatsAPI++
diff options
context:
space:
mode:
authorGeorge Hazan <george.hazan@gmail.com>2015-01-27 22:31:27 +0000
committerGeorge Hazan <george.hazan@gmail.com>2015-01-27 22:31:27 +0000
commit7b8863e70b56e49ee752a3420f464ecb20faae35 (patch)
tree15f53cb14e6798e8ca23fc46591d84bf88e25ae0 /protocols/WhatsApp/src/WhatsAPI++
parentf5040450314c4b4ab23ab3b93ab93e0dcb2ebba8 (diff)
final version of ping
git-svn-id: http://svn.miranda-ng.org/main/trunk@11933 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++')
-rw-r--r--protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp7
1 files changed, 6 insertions, 1 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
index 961c3ea544..a10fa28df5 100644
--- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
+++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp
@@ -798,7 +798,12 @@ void WAConnection::sendPaused(const std::string& to) throw(WAException)
void WAConnection::sendPing() throw(WAException)
{
- this->out->write(ProtocolTreeNode(""));
+ std::string id = makeId("ping_");
+ this->pending_server_requests[id] = new IqResultPingHandler(this);
+
+ ProtocolTreeNode *pingNode = new ProtocolTreeNode("ping");
+ this->out->write(ProtocolTreeNode("iq", pingNode)
+ << XATTR("id", id) << XATTR("xmlns", "w:p") << XATTR("type", "get") << XATTR("to", "s.whatsapp.net"));
}
void WAConnection::sendPong(const std::string& id) throw(WAException)