[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:03 UTC 2016
Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-auth-handler.git;a=commitdiff;h=670738f
The following commit has been merged in the master branch:
commit 670738fee8b9f93a0fd40051310c91d9b3503728
Author: David Edmundson <kde at davidedmundson.co.uk>
Date: Fri Apr 5 10:39:07 2013 +0200
Fix SSO Operation
---
x-telepathy-sso-operation.cpp | 36 +++++++++++++++++++++++++++---------
x-telepathy-sso-operation.h | 13 ++++++++++---
2 files changed, 37 insertions(+), 12 deletions(-)
diff --git a/x-telepathy-sso-operation.cpp b/x-telepathy-sso-operation.cpp
index a57812c..ada1e24 100644
--- a/x-telepathy-sso-operation.cpp
+++ b/x-telepathy-sso-operation.cpp
@@ -16,15 +16,19 @@
along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
+#include "x-telepathy-sso-operation.h"
+
#include <TelepathyQt/Account>
#include <TelepathyQt/ChannelInterfaceSASLAuthenticationInterface>
+#include <TelepathyQt/AccountInterfaceStorageInterface>
+
+#include <TelepathyQt/PendingVariantMap>
#include <Accounts/Account>
#include <KDebug>
#include <KUrl>
-#include "x-telepathy-sso-operation.h"
#include "getcredentialsjob.h"
XTelepathySSOOperation::XTelepathySSOOperation(const Tp::AccountPtr& account, Tp::Client::ChannelInterfaceSASLAuthenticationInterface* saslIface) :
@@ -43,8 +47,14 @@ void XTelepathySSOOperation::onSASLStatusChanged(uint status, const QString &rea
qDebug() << "details" << details;
switch (status){
case Tp::SASLStatusNotStarted:
- kDebug() << "starting credentials job";
- m_saslIface->StartMechanism(QLatin1String("X-FACEBOOK-PLATFORM"));
+ {
+ kDebug() << "starting credentials job";
+ //FIXME this leaks.
+ Tp::Client::AccountInterfaceStorageInterface *accountStorageInterface = new Tp::Client::AccountInterfaceStorageInterface(m_account->busName(), m_account->objectPath());
+ Tp::PendingVariantMap *pendingMap = accountStorageInterface->requestAllProperties();
+ connect(pendingMap, SIGNAL(finished(Tp::PendingOperation*)), SLOT(onGetAccountStorageFetched(Tp::PendingOperation*)));
+ break;
+ }
case Tp::SASLStatusServerSucceeded:
kDebug() << "Authentication handshake";
m_saslIface->AcceptSASL();
@@ -54,16 +64,16 @@ void XTelepathySSOOperation::onSASLStatusChanged(uint status, const QString &rea
void XTelepathySSOOperation::onNewChallenge(const QByteArray& array)
{
- kDebug() << "new challenge" << array;
+ kDebug() << "new challenge" << array;
kDebug() << "responding again";
-
- GetCredentialsJob *job = new GetCredentialsJob(11, this);
+
+ GetCredentialsJob *job = new GetCredentialsJob(m_accountStorageId, this);
kDebug() << "made new credentials job..starting";
job->exec();
-
+
KUrl fbRequestUrl;
KUrl fbResponseUrl;
-
+
fbRequestUrl.setQuery(array);
kDebug() << fbRequestUrl.queryItemValue("version");
@@ -73,11 +83,19 @@ void XTelepathySSOOperation::onNewChallenge(const QByteArray& array)
fbResponseUrl.addQueryItem("api_key", job->credentialsData()["ClientId"].toString());
fbResponseUrl.addQueryItem("call_id", "0");
fbResponseUrl.addQueryItem("v", "1.0");
-
+
//.mid(1) trims leading '?' char
kDebug() << fbResponseUrl.query().mid(1);
m_saslIface->Respond(fbResponseUrl.query().mid(1).toUtf8());
}
+void XTelepathySSOOperation::onGetAccountStorageFetched(Tp::PendingOperation *op)
+{
+ kDebug() << "DAVE LOOK HERE";
+ Tp::PendingVariantMap *pendingMap = qobject_cast<Tp::PendingVariantMap*>(op);
+
+ m_accountStorageId = pendingMap->result()["StorageIdentifier"].value<QDBusVariant>().variant().toInt();
+ m_saslIface->StartMechanism(QLatin1String("X-FACEBOOK-PLATFORM"));
+}
diff --git a/x-telepathy-sso-operation.h b/x-telepathy-sso-operation.h
index f1dfaba..ca411a3 100644
--- a/x-telepathy-sso-operation.h
+++ b/x-telepathy-sso-operation.h
@@ -29,7 +29,7 @@
class GetCredentialsJob;
class XTelepathySSOOperation : public Tp::PendingOperation
-{
+{
Q_OBJECT
Q_DISABLE_COPY(XTelepathySSOOperation)
@@ -42,11 +42,18 @@ public:
private Q_SLOTS:
void onSASLStatusChanged(uint status, const QString &reason, const QVariantMap &details);
void onNewChallenge(const QByteArray &array);
-
+
+ //FIXME this is a wordaround until Tp::Client::AccountInterfaceStorageInterface is merged into Tp::Account
+ void onGetAccountStorageFetched(Tp::PendingOperation *op);
+
private:
Tp::AccountPtr m_account;
Tp::Client::ChannelInterfaceSASLAuthenticationInterface *m_saslIface;
-
+
+ //FIXME hack as part of above
+ int m_accountStorageId;
+
+
friend class SaslAuthOp;
};
--
ktp-auth-handler packaging
More information about the pkg-kde-commits
mailing list