From 7b8863e70b56e49ee752a3420f464ecb20faae35 Mon Sep 17 00:00:00 2001 From: George Hazan Date: Tue, 27 Jan 2015 22:31:27 +0000 Subject: final version of ping git-svn-id: http://svn.miranda-ng.org/main/trunk@11933 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) (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 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) -- cgit v1.2.3