From 194762951e6a59808350032f38e05cd0e5d03807 Mon Sep 17 00:00:00 2001 From: Jeremy Lainé Date: Thu, 7 Apr 2011 18:27:51 +0000 Subject: make password checking full asynchronous --- tests/tests.cpp | 15 +++++++-------- 1 file changed, 7 insertions(+), 8 deletions(-) (limited to 'tests/tests.cpp') diff --git a/tests/tests.cpp b/tests/tests.cpp index f603a31d..f7511078 100644 --- a/tests/tests.cpp +++ b/tests/tests.cpp @@ -33,10 +33,10 @@ #include "QXmppArchiveIq.h" #include "QXmppBindIq.h" #include "QXmppClient.h" -#include "QXmppIncomingClient.h" #include "QXmppJingleIq.h" #include "QXmppMessage.h" #include "QXmppNonSASLAuth.h" +#include "QXmppPasswordChecker.h" #include "QXmppPresence.h" #include "QXmppPubSubIq.h" #include "QXmppRpcIq.h" @@ -941,25 +941,24 @@ public: }; /// Retrieves the password for the given username. - Error getPassword(const QString &username, const QString &domain, QString &password) + QXmppPasswordReply::Error getPassword(const QXmppPasswordRequest &request, QString &password) { - Q_UNUSED(domain); - - if (username == m_username) + if (request.username() == m_username) { password = m_password; - return NoError; + return QXmppPasswordReply::NoError; } else { - return AuthorizationError; + return QXmppPasswordReply::AuthorizationError; } }; + /// Sets whether getPassword() is enabled. void setGetPassword(bool getPassword) { m_getPassword = getPassword; } - /// Returns true as we implemented getPassword(). + /// Returns whether getPassword() is enabled. bool hasGetPassword() const { return m_getPassword; -- cgit v1.2.3