[SCM] ktp-auth-handler packaging branch, master, updated. debian/15.12.1-2-282-g080758e
Maximiliano Curia
maxy at moszumanska.debian.org
Fri May 27 23:59:08 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-auth-handler.git;a=commitdiff;h=e4063f1
The following commit has been merged in the master branch:
commit e4063f1be914f337fed5f9e5c07174af03e7ef15
Author: Àlex Fiestas <afiestas at kde.org>
Date: Fri Jun 7 13:54:10 2013 +0200
Call GetCredentialsJob asynchronously
---
x-telepathy-sso-operation.cpp | 25 ++++++++++++++++---------
x-telepathy-sso-operation.h | 8 +++++---
2 files changed, 21 insertions(+), 12 deletions(-)
diff --git a/x-telepathy-sso-operation.cpp b/x-telepathy-sso-operation.cpp
index a520eca..72a9992 100644
--- a/x-telepathy-sso-operation.cpp
+++ b/x-telepathy-sso-operation.cpp
@@ -62,25 +62,34 @@ void XTelepathySSOOperation::onSASLStatusChanged(uint status, const QString &rea
}
}
-void XTelepathySSOOperation::onNewChallenge(const QByteArray& array)
+void XTelepathySSOOperation::onNewChallenge(const QByteArray& challengeData)
{
- kDebug() << "new challenge" << array;
+ kDebug() << "new challenge" << challengeData;
kDebug() << "responding again";
+ m_challengeData = challengeData;
+
+ kDebug() << "made new credentials job..starting: " << m_accountStorageId;
GetCredentialsJob *job = new GetCredentialsJob(m_accountStorageId, this);
- kDebug() << "made new credentials job..starting";
- job->exec();
+ connect(job, SIGNAL(finished(KJob*)), SLOT(gotCredentials(KJob *)));
+ job->start();
+}
+void XTelepathySSOOperation::gotCredentials(KJob *kJob)
+{
+ kDebug();
KUrl fbRequestUrl;
KUrl fbResponseUrl;
- fbRequestUrl.setQuery(array);
+ fbRequestUrl.setQuery(m_challengeData);
kDebug() << fbRequestUrl.queryItemValue("version");
+ GetCredentialsJob *job = qobject_cast< GetCredentialsJob* >(kJob);
+ QVariantMap credentialsData = job->credentialsData();
fbResponseUrl.addQueryItem("method", fbRequestUrl.queryItemValue("method"));
fbResponseUrl.addQueryItem("nonce", fbRequestUrl.queryItemValue("nonce"));
- fbResponseUrl.addQueryItem("access_token", job->credentialsData()["AccessToken"].toString());
- fbResponseUrl.addQueryItem("api_key", job->credentialsData()["ClientId"].toString());
+ fbResponseUrl.addQueryItem("access_token", credentialsData["AccessToken"].toString());
+ fbResponseUrl.addQueryItem("api_key", credentialsData["ClientId"].toString());
fbResponseUrl.addQueryItem("call_id", "0");
fbResponseUrl.addQueryItem("v", "1.0");
@@ -88,5 +97,3 @@ void XTelepathySSOOperation::onNewChallenge(const QByteArray& array)
kDebug() << fbResponseUrl.query().mid(1);
m_saslIface->Respond(fbResponseUrl.query().mid(1).toUtf8());
}
-
-
diff --git a/x-telepathy-sso-operation.h b/x-telepathy-sso-operation.h
index 0105b76..8978127 100644
--- a/x-telepathy-sso-operation.h
+++ b/x-telepathy-sso-operation.h
@@ -25,8 +25,7 @@
#include <TelepathyQt/Channel>
#include <TelepathyQt/Account>
-
-class GetCredentialsJob;
+class KJob;
class XTelepathySSOOperation : public Tp::PendingOperation
{
@@ -42,12 +41,15 @@ public:
private Q_SLOTS:
void onSASLStatusChanged(uint status, const QString &reason, const QVariantMap &details);
- void onNewChallenge(const QByteArray &array);
+ void onNewChallenge(const QByteArray &challengeData);
+ void gotCredentials(KJob *kjob);
private:
Tp::AccountPtr m_account;
Tp::Client::ChannelInterfaceSASLAuthenticationInterface *m_saslIface;
+ QByteArray m_challengeData;
+
//FIXME hack as part of above
int m_accountStorageId;
--
ktp-auth-handler packaging
More information about the pkg-kde-commits
mailing list