From 50734ee3a33dd1277c7586ffdbed5d43a82875c1 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 30 Aug 2012 10:59:29 +0200 Subject: Make sure QXmppDiscoveryManager only emits results --- CHANGELOG | 1 + src/client/QXmppDiscoveryManager.cpp | 14 +++++++++----- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/CHANGELOG b/CHANGELOG index 7d4fbeb8..76480e9e 100644 --- a/CHANGELOG +++ b/CHANGELOG @@ -6,6 +6,7 @@ QXmpp 0.6.4 (UNRELEASED) * Make it possible to have several e-mail addresses. * Make it possible to have several phone numbers. - Make it possible to set the client's extended information form (XEP-0128). + - Make sure QXmppDiscoveryManager only emits results. - Fix XEP-0115 verification strings (remove duplicate features, sort form values) - Fix issues: * Issue 144: QXmppBookmarkConference autojoin parsing diff --git a/src/client/QXmppDiscoveryManager.cpp b/src/client/QXmppDiscoveryManager.cpp index 778e36e5..9582853b 100644 --- a/src/client/QXmppDiscoveryManager.cpp +++ b/src/client/QXmppDiscoveryManager.cpp @@ -258,19 +258,23 @@ bool QXmppDiscoveryManager::handleStanza(const QDomElement &element) if(receivedIq.type() == QXmppIq::Get && receivedIq.queryType() == QXmppDiscoveryIq::InfoQuery && - (receivedIq.queryNode().isEmpty() || receivedIq.queryNode().startsWith(d->clientCapabilitiesNode))) - { + (receivedIq.queryNode().isEmpty() || + receivedIq.queryNode().startsWith(d->clientCapabilitiesNode))) { // respond to query QXmppDiscoveryIq qxmppFeatures = capabilities(); qxmppFeatures.setId(receivedIq.id()); qxmppFeatures.setTo(receivedIq.from()); qxmppFeatures.setQueryNode(receivedIq.queryNode()); client()->sendPacket(qxmppFeatures); - } - else if(receivedIq.queryType() == QXmppDiscoveryIq::InfoQuery) + } else if(receivedIq.type() == QXmppIq::Result && + receivedIq.queryType() == QXmppDiscoveryIq::InfoQuery) { + // info result emit infoReceived(receivedIq); - else if(receivedIq.queryType() == QXmppDiscoveryIq::ItemsQuery) + } else if(receivedIq.type() == QXmppIq::Result && + receivedIq.queryType() == QXmppDiscoveryIq::ItemsQuery) { + // items result emit itemsReceived(receivedIq); + } return true; } -- cgit v1.2.3