From 821ac0b4dbeccd98d4483efcafecd82efbd55d8f Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 26 Aug 2010 07:50:11 +0000 Subject: rework QXmppPasswordChecker --- src/QXmppIncomingClient.cpp | 12 +++++------- 1 file changed, 5 insertions(+), 7 deletions(-) (limited to 'src/QXmppIncomingClient.cpp') diff --git a/src/QXmppIncomingClient.cpp b/src/QXmppIncomingClient.cpp index e66b893f..6a2e5c49 100644 --- a/src/QXmppIncomingClient.cpp +++ b/src/QXmppIncomingClient.cpp @@ -146,7 +146,7 @@ void QXmppIncomingClient::handleStream(const QDomElement &streamElement) { QList mechanisms; mechanisms << QXmppConfiguration::SASLPlain; - if (d->passwordChecker->hasPasswords()) + if (d->passwordChecker->hasGetPassword()) mechanisms << QXmppConfiguration::SASLDigestMD5; features.setAuthMechanisms(mechanisms); } @@ -183,7 +183,7 @@ void QXmppIncomingClient::handleStanza(const QDomElement &nodeRecv) const QString username = QString::fromUtf8(auth[1]); const QString password = QString::fromUtf8(auth[2]); - if (d->passwordChecker && d->passwordChecker->checkCredentials(username, password)) + if (d->passwordChecker && d->passwordChecker->checkPassword(username, password)) { d->username = username; sendData(""); @@ -314,7 +314,7 @@ void QXmppIncomingClient::slotTimeout() /// Retrieves the password for the given username. /// -/// Reimplement this method to support DIGEST-MD5 authentication. +/// You need to reimplement this method to support DIGEST-MD5 authentication. /// /// \param username /// \param password @@ -326,12 +326,10 @@ bool QXmppPasswordChecker::getPassword(const QString &username, QString &passwor return false; } -/// Returns true if it is possible to retrieve passwords. +/// Returns true if the getPassword() method is implemented. /// -/// Reimplement this method and return true if you provided a -/// getPassword() method. -bool QXmppPasswordChecker::hasPasswords() const +bool QXmppPasswordChecker::hasGetPassword() const { return false; } -- cgit v1.2.3