From 42bde6cec9c2be75c1a8a719d5b9408b48ed61b0 Mon Sep 17 00:00:00 2001 From: Alberto Mardegan Date: Tue, 14 Sep 2021 21:39:35 +0300 Subject: [PATCH] google: check client credentials only with Sailfish key provider Accounts not using Sailfish key provider will get their client ID and secret from the account's AuthData class. --- src/google/googledatatypesyncadaptor.cpp | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/src/google/googledatatypesyncadaptor.cpp b/src/google/googledatatypesyncadaptor.cpp index 1e3d624..1fa14b3 100644 --- a/src/google/googledatatypesyncadaptor.cpp +++ b/src/google/googledatatypesyncadaptor.cpp @@ -60,6 +60,7 @@ void GoogleDataTypeSyncAdaptor::sync(const QString &dataTypeString, int accountI return; } +#ifdef USE_SAILFISHKEYPROVIDER if (clientId().isEmpty()) { SOCIALD_LOG_ERROR("client id couldn't be retrieved for Google account" << accountId); setStatus(SocialNetworkSyncAdaptor::Error); @@ -71,6 +72,7 @@ void GoogleDataTypeSyncAdaptor::sync(const QString &dataTypeString, int accountI setStatus(SocialNetworkSyncAdaptor::Error); return; } +#endif setStatus(SocialNetworkSyncAdaptor::Busy); updateDataForAccount(accountId); @@ -209,10 +211,16 @@ void GoogleDataTypeSyncAdaptor::signIn(Accounts::Account *account) { // Fetch consumer key and secret from keyprovider int accountId = account->id(); - if (!checkAccount(account) || clientId().isEmpty() || clientSecret().isEmpty()) { + if (!checkAccount(account)) { decrementSemaphore(accountId); return; } +#ifdef USE_SAILFISHKEYPROVIDER + if (clientId().isEmpty() || clientSecret().isEmpty()) { + decrementSemaphore(accountId); + return; + } +#endif // grab out a valid identity for the sync service. Accounts::Service srv(m_accountManager->service(syncServiceName()));