diff options
| author | Linus Jahn <lnj@kaidan.im> | 2022-10-16 21:52:26 +0200 |
|---|---|---|
| committer | Linus Jahn <lnj@kaidan.im> | 2022-10-17 16:26:03 +0200 |
| commit | 556442eab0bdbd5b30a5fad3112d88c4b124ff5e (patch) | |
| tree | c82c8d27ed353f9cd79538a0c0e7e620a481ce10 /src/client/QXmppIqHandling.cpp | |
| parent | 66e5f060abe831fa08a758b9de44b29bfec8b3ba (diff) | |
| download | qxmpp-556442eab0bdbd5b30a5fad3112d88c4b124ff5e.tar.gz | |
Add automated IQ request handling functions
Diffstat (limited to 'src/client/QXmppIqHandling.cpp')
| -rw-r--r-- | src/client/QXmppIqHandling.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/src/client/QXmppIqHandling.cpp b/src/client/QXmppIqHandling.cpp new file mode 100644 index 00000000..be164f0f --- /dev/null +++ b/src/client/QXmppIqHandling.cpp @@ -0,0 +1,27 @@ +// SPDX-FileCopyrightText: 2022 Linus Jahn <lnj@kaidan.im> +// +// SPDX-License-Identifier: LGPL-2.1-or-later + +#include "QXmppIqHandling.h" + +void QXmpp::Private::sendIqReply(QXmppClient *client, + const QString &requestId, + const QString &requestFrom, + const std::optional<QXmppE2eeMetadata> &e2eeMetadata, + QXmppIq &&iq) +{ + // default type is 'result' + switch (iq.type()) { + case QXmppIq::Get: + case QXmppIq::Set: + iq.setType(QXmppIq::Result); + break; + case QXmppIq::Error: + case QXmppIq::Result: + break; + } + + iq.setTo(requestFrom); + iq.setId(requestId); + client->reply(std::move(iq), e2eeMetadata); +} |
