diff options
Diffstat (limited to 'src/client/QXmppIqHandling.cpp')
| -rw-r--r-- | src/client/QXmppIqHandling.cpp | 13 |
1 files changed, 13 insertions, 0 deletions
diff --git a/src/client/QXmppIqHandling.cpp b/src/client/QXmppIqHandling.cpp index be164f0f..ddc980fe 100644 --- a/src/client/QXmppIqHandling.cpp +++ b/src/client/QXmppIqHandling.cpp @@ -25,3 +25,16 @@ void QXmpp::Private::sendIqReply(QXmppClient *client, iq.setId(requestId); client->reply(std::move(iq), e2eeMetadata); } + +std::tuple<bool, QString, QString> QXmpp::Private::checkIsIqRequest(const QDomElement &el) +{ + if (el.tagName() != QStringLiteral("iq")) { + return { false, {}, {} }; + } + auto queryElement = el.firstChildElement(); + auto iqType = el.attribute(QStringLiteral("type")); + if (iqType != QStringLiteral("get") && iqType != QStringLiteral("set")) { + return { false, {}, {} }; + } + return { true, queryElement.tagName(), queryElement.namespaceURI() }; +} |
