From 3caffcebf16680576d8dd785437eed16a6c5f36d Mon Sep 17 00:00:00 2001 From: Linus Jahn Date: Wed, 9 Sep 2020 15:05:23 +0200 Subject: Add reporting of IQ responses with QFutures --- src/client/QXmppClient.cpp | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) (limited to 'src/client/QXmppClient.cpp') diff --git a/src/client/QXmppClient.cpp b/src/client/QXmppClient.cpp index 6933a0a6..4f8bfc26 100644 --- a/src/client/QXmppClient.cpp +++ b/src/client/QXmppClient.cpp @@ -38,6 +38,7 @@ #include "QXmppVCardManager.h" #include "QXmppVersionManager.h" +#include #include #include #include @@ -109,6 +110,14 @@ QStringList QXmppClientPrivate::discoveryFeatures() } /// \endcond +/// +/// \typedef QXmppClient::IqResult +/// +/// Result of an IQ request, either contains the QDomElement of the IQ answer +/// (with type 'error' or 'result') or it contains the packet error, if the +/// request couldn't be sent. +/// + /// Creates a QXmppClient object. /// \param parent is passed to the QObject's constructor. /// The default value is 0. @@ -333,6 +342,18 @@ QFuture QXmppClient::send(const QXmppStanza &stanza) return d->stream->send(stanza); } +/// +/// Sends an IQ packet and returns the response asynchronously. +/// +/// \warning THIS API IS NOT FINALIZED YET! +/// +/// \since QXmpp 1.5 +/// +QFuture QXmppClient::sendIq(const QXmppIq &iq) +{ + return d->stream->sendIq(iq); +} + /// Disconnects the client and the current presence of client changes to /// QXmppPresence::Unavailable and status text changes to "Logged out". /// -- cgit v1.2.3