diff options
Diffstat (limited to 'protocols/WhatsApp/src/WhatsAPI++')
| -rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp | 5 | ||||
| -rw-r--r-- | protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp | 8 |
2 files changed, 6 insertions, 7 deletions
diff --git a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp index e9b6377879..0dea74a6ac 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/BinTreeNodeWriter.cpp @@ -266,7 +266,10 @@ void BinTreeNodeWriter::write(const ProtocolTreeNode &node, bool needsFlush) this->realOut->log(tmp.c_str());
}
#endif
- writeInternal(node);
+ if (node.tag.empty())
+ this->out->write(0);
+ else
+ writeInternal(node);
flushBuffer(needsFlush);
}
catch (exception& ex) {
diff --git a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp index c7ce6648c8..961c3ea544 100644 --- a/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp +++ b/protocols/WhatsApp/src/WhatsAPI++/WAConnection.cpp @@ -778,7 +778,7 @@ void WAConnection::sendMessageReceived(FMessage* message) throw(WAException) << XATTR("xmlns", "urn:xmpp:receipts");
this->out->write(ProtocolTreeNode("message", receivedNode)
- << XATTR("to", message->key->remote_jid) << XATTR("type", "chat") << XATTR("id", message->key->id));
+ << XATTR("to", message->key->remote_jid) << XATTR("type", "text") << XATTR("id", message->key->id));
}
/////////////////////////////////////////////////////////////////////////////////////////
@@ -798,11 +798,7 @@ void WAConnection::sendPaused(const std::string& to) throw(WAException) void WAConnection::sendPing() throw(WAException)
{
- std::string id = makeId("ping_");
- this->pending_server_requests[id] = new IqResultPingHandler(this);
-
- ProtocolTreeNode *pingNode = new ProtocolTreeNode("ping") << XATTR("xmlns", "w:p");
- this->out->write(ProtocolTreeNode("iq", pingNode) << XATTR("id", id) << XATTR("type", "get"));
+ this->out->write(ProtocolTreeNode(""));
}
void WAConnection::sendPong(const std::string& id) throw(WAException)
|
