[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:07 UTC 2016


Gitweb-URL: http://git.debian.org/?p=pkg-kde/applications/ktp-auth-handler.git;a=commitdiff;h=56fdbd6

The following commit has been merged in the master branch:
commit 56fdbd661ef9082e341bec4f09348eb097af8756
Author: Àlex Fiestas <afiestas at kde.org>
Date:   Fri Jun 7 13:02:46 2013 +0200

    Fetch StorageIdentifier in SaslAuthOp and pass it to XTelepathySSOOp
    
    We are going to need the StoargeIdentifier to decide wheter we
    prioritize the mechanism for KDE Accounts, so we need to move the
    operation of fetching outsite the XTelepathySSOOperation.
---
 sasl-auth-op.cpp              | 16 ++++++++++++++++
 sasl-auth-op.h                |  4 ++++
 x-telepathy-sso-operation.cpp | 17 ++++-------------
 x-telepathy-sso-operation.h   |  4 +---
 4 files changed, 25 insertions(+), 16 deletions(-)

diff --git a/sasl-auth-op.cpp b/sasl-auth-op.cpp
index ce43e0e..1c74c09 100644
--- a/sasl-auth-op.cpp
+++ b/sasl-auth-op.cpp
@@ -38,6 +38,7 @@ SaslAuthOp::SaslAuthOp(const Tp::AccountPtr &account,
       m_walletInterface(0),
       m_account(account),
       m_channel(channel),
+      m_accountStorageId(0),
       m_saslIface(channel->interface<Tp::Client::ChannelInterfaceSASLAuthenticationInterface>())
 {
     connect(KTp::WalletInterface::openWallet(), SIGNAL(finished(Tp::PendingOperation*)), SLOT(onOpenWalletOperationFinished(Tp::PendingOperation*)));
@@ -63,6 +64,7 @@ void SaslAuthOp::gotProperties(Tp::PendingOperation *op)
 
     if (mechanisms.contains(QLatin1String("X-FACEBOOK-PLATFORM"))) {
         XTelepathySSOOperation *authop = new XTelepathySSOOperation(m_account, m_saslIface);
+        XTelepathySSOOperation *authop = new XTelepathySSOOperation(m_account, m_accountStorageId, m_saslIface);
         connect(authop,
                 SIGNAL(finished(Tp::PendingOperation*)),
                 SLOT(onAuthOperationFinished(Tp::PendingOperation*)));
@@ -110,6 +112,20 @@ void SaslAuthOp::onOpenWalletOperationFinished(Tp::PendingOperation *op)
 
     m_walletInterface = walletOp->walletInterface();
 
+    //Check if the account has any StorageIdentifier, in which case we will
+    //prioritize those mechanism related with KDE Accounts integration
+    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*)));
+}
+
+void SaslAuthOp::onGetAccountStorageFetched(Tp::PendingOperation* op)
+{
+    kDebug();
+    Tp::PendingVariantMap *pendingMap = qobject_cast<Tp::PendingVariantMap*>(op);
+
+    m_accountStorageId = pendingMap->result()["StorageIdentifier"].value<QDBusVariant>().variant().toInt();
+    kDebug() << m_accountStorageId;
     connect(m_saslIface->requestAllProperties(),
             SIGNAL(finished(Tp::PendingOperation*)),
             SLOT(gotProperties(Tp::PendingOperation*)));
diff --git a/sasl-auth-op.h b/sasl-auth-op.h
index 6e0e5ef..ecd4da1 100644
--- a/sasl-auth-op.h
+++ b/sasl-auth-op.h
@@ -44,12 +44,16 @@ Q_SIGNALS:
 private Q_SLOTS:
     void gotProperties(Tp::PendingOperation *op);
     void onOpenWalletOperationFinished(Tp::PendingOperation *op);
+    //FIXME this is a wordaround until Tp::Client::AccountInterfaceStorageInterface is merged into Tp::Account
+    //https://bugs.freedesktop.org/show_bug.cgi?id=63191
+    void onGetAccountStorageFetched(Tp::PendingOperation *op);
     void onAuthOperationFinished(Tp::PendingOperation *op);
 
 private:
     KTp::WalletInterface *m_walletInterface;
     Tp::AccountPtr m_account;
     Tp::ChannelPtr m_channel;
+    int m_accountStorageId;
     Tp::Client::ChannelInterfaceSASLAuthenticationInterface *m_saslIface;
 };
 
diff --git a/x-telepathy-sso-operation.cpp b/x-telepathy-sso-operation.cpp
index 1e01a88..a520eca 100644
--- a/x-telepathy-sso-operation.cpp
+++ b/x-telepathy-sso-operation.cpp
@@ -31,11 +31,13 @@
 
 #include "getcredentialsjob.h"
 
-XTelepathySSOOperation::XTelepathySSOOperation(const Tp::AccountPtr& account, Tp::Client::ChannelInterfaceSASLAuthenticationInterface* saslIface) :
+XTelepathySSOOperation::XTelepathySSOOperation(const Tp::AccountPtr& account, int accountStorageId, Tp::Client::ChannelInterfaceSASLAuthenticationInterface* saslIface) :
     PendingOperation(account),
     m_account(account),
+    m_accountStorageId(accountStorageId),
     m_saslIface(saslIface)
 {
+    Q_ASSERT(m_accountStorageId);
     connect(m_saslIface, SIGNAL(SASLStatusChanged(uint,QString,QVariantMap)), SLOT(onSASLStatusChanged(uint,QString,QVariantMap)));
     connect(m_saslIface, SIGNAL(NewChallenge(QByteArray)), SLOT(onNewChallenge(QByteArray)));
 }
@@ -50,9 +52,7 @@ void XTelepathySSOOperation::onSASLStatusChanged(uint status, const QString &rea
     {
         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*)));
+        m_saslIface->StartMechanism(QLatin1String("X-FACEBOOK-PLATFORM"));
         break;
     }
     case Tp::SASLStatusServerSucceeded:
@@ -89,13 +89,4 @@ void XTelepathySSOOperation::onNewChallenge(const QByteArray& array)
     m_saslIface->Respond(fbResponseUrl.query().mid(1).toUtf8());
 }
 
-void XTelepathySSOOperation::onGetAccountStorageFetched(Tp::PendingOperation *op)
-{
-    kDebug();
-    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 ca411a3..0105b76 100644
--- a/x-telepathy-sso-operation.h
+++ b/x-telepathy-sso-operation.h
@@ -36,6 +36,7 @@ class XTelepathySSOOperation : public Tp::PendingOperation
 public:
     explicit XTelepathySSOOperation(
             const Tp::AccountPtr &account,
+            int accountStorageId,
             Tp::Client::ChannelInterfaceSASLAuthenticationInterface *saslIface);
 //     ~XTelepathySSOOperation();
 
@@ -43,9 +44,6 @@ 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;

-- 
ktp-auth-handler packaging



More information about the pkg-kde-commits mailing list