diff options
| author | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-29 13:30:20 +0000 |
|---|---|---|
| committer | Jeremy Lainé <jeremy.laine@m4x.org> | 2010-08-29 13:30:20 +0000 |
| commit | 1dda2e3834621a6ecda6295bb19993aff4efbac6 (patch) | |
| tree | ce44e3136c604f540c97bdc2f2f4d003f7eeaf6d /src/QXmppOutgoingClient.cpp | |
| parent | 1bcb401ba2033422fdeb72613075c919da64a33c (diff) | |
| download | qxmpp-1dda2e3834621a6ecda6295bb19993aff4efbac6.tar.gz | |
refactor stream features parsing
Diffstat (limited to 'src/QXmppOutgoingClient.cpp')
| -rw-r--r-- | src/QXmppOutgoingClient.cpp | 16 |
1 files changed, 8 insertions, 8 deletions
diff --git a/src/QXmppOutgoingClient.cpp b/src/QXmppOutgoingClient.cpp index 38e06ddb..f7fc8bc3 100644 --- a/src/QXmppOutgoingClient.cpp +++ b/src/QXmppOutgoingClient.cpp @@ -237,17 +237,17 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) { // determine TLS mode to use const QXmppConfiguration::StreamSecurityMode localSecurity = configuration().streamSecurityMode(); - const QXmppConfiguration::StreamSecurityMode remoteSecurity = features.securityMode(); + const QXmppStreamFeatures::Mode remoteSecurity = features.tlsMode(); if (!socket()->supportsSsl() && (localSecurity == QXmppConfiguration::TLSRequired || - remoteSecurity == QXmppConfiguration::TLSRequired)) + remoteSecurity == QXmppStreamFeatures::Required)) { warning("Disconnecting as TLS is required, but SSL support is not available"); disconnectFromHost(); return; } if (localSecurity == QXmppConfiguration::TLSRequired && - remoteSecurity == QXmppConfiguration::TLSDisabled) + remoteSecurity == QXmppStreamFeatures::Disabled) { warning("Disconnecting as TLS is required, but not supported by the server"); disconnectFromHost(); @@ -255,8 +255,8 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } if (socket()->supportsSsl() && - remoteSecurity != QXmppConfiguration::TLSDisabled && - localSecurity != QXmppConfiguration::TLSDisabled) + localSecurity != QXmppConfiguration::TLSDisabled && + remoteSecurity != QXmppStreamFeatures::Disabled) { // enable TLS as it is support by both parties sendData("<starttls xmlns='urn:ietf:params:xml:ns:xmpp-tls'/>"); @@ -265,7 +265,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } // handle authentication - const bool nonSaslAvailable = features.isNonSaslAuthAvailable(); + const bool nonSaslAvailable = features.nonSaslAuthMode() != QXmppStreamFeatures::Disabled; const bool saslAvailable = !features.authMechanisms().isEmpty(); const bool useSasl = configuration().useSASLAuthentication(); if((saslAvailable && nonSaslAvailable && !useSasl) || @@ -313,7 +313,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } // check whether bind is available - if (features.isBindAvailable()) + if (features.bindMode() != QXmppStreamFeatures::Disabled) { QXmppBindIq bind; bind.setType(QXmppIq::Set); @@ -323,7 +323,7 @@ void QXmppOutgoingClient::handleStanza(const QDomElement &nodeRecv) } // check whether session is available - if (features.isSessionAvailable()) + if (features.sessionMode() != QXmppStreamFeatures::Disabled) d->sessionAvailable = true; } else if(ns == ns_stream && nodeRecv.tagName() == "error") |
