aboutsummaryrefslogtreecommitdiff
path: root/src/base/QXmppDiscoveryIq.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'src/base/QXmppDiscoveryIq.cpp')
-rw-r--r--src/base/QXmppDiscoveryIq.cpp11
1 files changed, 8 insertions, 3 deletions
diff --git a/src/base/QXmppDiscoveryIq.cpp b/src/base/QXmppDiscoveryIq.cpp
index 99860c9b..414a2d0f 100644
--- a/src/base/QXmppDiscoveryIq.cpp
+++ b/src/base/QXmppDiscoveryIq.cpp
@@ -433,12 +433,17 @@ QByteArray QXmppDiscoveryIq::verificationString() const
///
bool QXmppDiscoveryIq::isDiscoveryIq(const QDomElement &element)
{
- QDomElement queryElement = element.firstChildElement("query");
- return (queryElement.namespaceURI() == ns_disco_info ||
- queryElement.namespaceURI() == ns_disco_items);
+ QDomElement queryElement = element.firstChildElement();
+ return checkIqType(queryElement.tagName(), queryElement.namespaceURI());
}
/// \cond
+bool QXmppDiscoveryIq::checkIqType(const QString &tagName, const QString &xmlNamespace)
+{
+ return tagName == QStringLiteral("query") &&
+ (xmlNamespace == ns_disco_info || xmlNamespace == ns_disco_items);
+}
+
void QXmppDiscoveryIq::parseElementFromChild(const QDomElement &element)
{
QDomElement queryElement = element.firstChildElement("query");