aboutsummaryrefslogtreecommitdiff
path: root/src/client/QXmppConfiguration.cpp
diff options
context:
space:
mode:
authorJeremy Lainé <jeremy.laine@m4x.org>2012-09-03 13:50:21 +0200
committerJeremy Lainé <jeremy.laine@m4x.org>2012-09-03 13:50:21 +0200
commitd51c6b146d8ca9d1a39bf2fbb6b7d5124dedf09b (patch)
treee561fc568dc844304974382825144d29225900b5 /src/client/QXmppConfiguration.cpp
parent088cf8e7232a25b31d8acc447e2224bc147b5411 (diff)
make it possible to disable non-SASL authentication
Diffstat (limited to 'src/client/QXmppConfiguration.cpp')
-rw-r--r--src/client/QXmppConfiguration.cpp31
1 files changed, 20 insertions, 11 deletions
diff --git a/src/client/QXmppConfiguration.cpp b/src/client/QXmppConfiguration.cpp
index b9452f38..d8a4b82e 100644
--- a/src/client/QXmppConfiguration.cpp
+++ b/src/client/QXmppConfiguration.cpp
@@ -58,10 +58,9 @@ public:
int keepAliveTimeout;
// will keep reconnecting if disconnected, default is true
bool autoReconnectionEnabled;
- bool useSASLAuthentication; ///< flag to specify what authentication system
- ///< to be used
- ///< defualt is true and use SASL
- ///< false would use NonSASL if available
+ // which authentication systems to use (if any)
+ bool useSASLAuthentication;
+ bool useNonSASLAuthentication;
// default is true
bool ignoreSslErrors;
@@ -84,6 +83,7 @@ QXmppConfigurationPrivate::QXmppConfigurationPrivate()
, keepAliveTimeout(20)
, autoReconnectionEnabled(true)
, useSASLAuthentication(true)
+ , useNonSASLAuthentication(true)
, ignoreSslErrors(true)
, streamSecurityMode(QXmppConfiguration::TLSEnabled)
, nonSASLAuthMechanism(QXmppConfiguration::NonSASLDigest)
@@ -410,25 +410,34 @@ void QXmppConfiguration::setIgnoreSslErrors(bool value)
d->ignoreSslErrors = value;
}
-/// Returns the type of authentication system specified by the user.
-/// \return true if SASL was specified else false. If the specified
-/// system is not available QXmpp will resort to the other one.
+/// Returns whether to make use of SASL authentication.
bool QXmppConfiguration::useSASLAuthentication() const
{
return d->useSASLAuthentication;
}
-/// Returns the type of authentication system specified by the user.
-/// \param useSASL to hint to use SASL authentication system if available.
-/// false will specify to use NonSASL XEP-0078: Non-SASL Authentication
-/// If the specified one is not availbe, library will use the othe one
+/// Sets whether to make use of SASL authentication.
void QXmppConfiguration::setUseSASLAuthentication(bool useSASL)
{
d->useSASLAuthentication = useSASL;
}
+/// Returns whether to make use of non-SASL authentication.
+
+bool QXmppConfiguration::useNonSASLAuthentication() const
+{
+ return d->useNonSASLAuthentication;
+}
+
+/// Sets whether to make use of non-SASL authentication.
+
+void QXmppConfiguration::setUseNonSASLAuthentication(bool useNonSASL)
+{
+ d->useNonSASLAuthentication = useNonSASL;
+}
+
/// Returns the specified security mode for the stream. The default value is
/// QXmppConfiguration::TLSEnabled.
/// \return StreamSecurityMode