diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-10 10:28:14 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-09-10 10:28:14 +0000 |
| commit | 952ff645038946b98d3ffe99b4bf4754bbbcc9b0 (patch) | |
| tree | 7b1e3f268af3cdfc229cd47019375e313fe8627c /src | |
| parent | 874b51e41dcff2187707f4331d274dbb37cde5b0 (diff) | |
| download | qxmpp-952ff645038946b98d3ffe99b4bf4754bbbcc9b0.tar.gz | |
let extensions report their features
Diffstat (limited to 'src')
| -rw-r--r-- | src/QXmppClient.cpp | 3 | ||||
| -rw-r--r-- | src/QXmppOutgoingClient.cpp | 10 | ||||
| -rw-r--r-- | src/QXmppOutgoingClient.h | 1 |
3 files changed, 13 insertions, 1 deletions
diff --git a/src/QXmppClient.cpp b/src/QXmppClient.cpp index bf27aad5..af4317a7 100644 --- a/src/QXmppClient.cpp +++ b/src/QXmppClient.cpp @@ -206,6 +206,9 @@ void QXmppClient::addExtension(QXmppClientExtension *extension) Q_ASSERT(check); Q_UNUSED(check); + // Features + d->stream->addFeatures(extension->discoveryFeatures()); + d->extensions << extension; } diff --git a/src/QXmppOutgoingClient.cpp b/src/QXmppOutgoingClient.cpp index cc225e5a..1f1bb331 100644 --- a/src/QXmppOutgoingClient.cpp +++ b/src/QXmppOutgoingClient.cpp @@ -74,6 +74,9 @@ public: QAbstractSocket::SocketError socketError; QXmppStanza::Error::Condition xmppStreamError; + // Discovery + QStringList extraFeatures; + // State data QString bindId; QString sessionId; @@ -803,6 +806,11 @@ QXmppStanza::Error::Condition QXmppOutgoingClient::xmppStreamError() return d->xmppStreamError; } +void QXmppOutgoingClient::addFeatures(const QStringList &features) +{ + d->extraFeatures << features; +} + QXmppDiscoveryIq QXmppOutgoingClient::capabilities() const { QXmppDiscoveryIq iq; @@ -818,7 +826,6 @@ QXmppDiscoveryIq QXmppOutgoingClient::capabilities() const << ns_vcard // XEP-0054: vcard-temp << ns_bytestreams // XEP-0065: SOCKS5 Bytestreams << ns_chat_states // XEP-0085: Chat State Notifications - << ns_version // XEP-0092: Software Version << ns_stream_initiation // XEP-0095: Stream Initiation << ns_stream_initiation_file_transfer // XEP-0096: SI File Transfer << ns_capabilities // XEP-0115 : Entity Capabilities @@ -827,6 +834,7 @@ QXmppDiscoveryIq QXmppOutgoingClient::capabilities() const << ns_jingle_rtp_audio << ns_jingle_ice_udp // XEP-0176 : Jingle ICE-UDP Transport Method << ns_ping; // XEP-0199: XMPP Ping + features << d->extraFeatures; iq.setFeatures(features); // identities diff --git a/src/QXmppOutgoingClient.h b/src/QXmppOutgoingClient.h index f1071995..f8f6e9d2 100644 --- a/src/QXmppOutgoingClient.h +++ b/src/QXmppOutgoingClient.h @@ -77,6 +77,7 @@ public: QXmppConfiguration& configuration(); + void addFeatures(const QStringList &features); QXmppElementList presenceExtensions() const; signals: |
