Skip to content

Commit

Permalink
Merge pull request #4 from mardy/mer-key-provider
Browse files Browse the repository at this point in the history
google: check client credentials only with Sailfish key provider
  • Loading branch information
chriadam committed Sep 20, 2021
2 parents be2b8ae + 42bde6c commit f09e294
Showing 1 changed file with 9 additions and 1 deletion.
10 changes: 9 additions & 1 deletion src/google/googledatatypesyncadaptor.cpp
Expand Up @@ -60,6 +60,7 @@ void GoogleDataTypeSyncAdaptor::sync(const QString &dataTypeString, int accountI
return;
}

#ifdef USE_SAILFISHKEYPROVIDER
if (clientId().isEmpty()) {
qCWarning(lcSocialPlugin) << "client id couldn't be retrieved for Google account" << accountId;
setStatus(SocialNetworkSyncAdaptor::Error);
Expand All @@ -71,6 +72,7 @@ void GoogleDataTypeSyncAdaptor::sync(const QString &dataTypeString, int accountI
setStatus(SocialNetworkSyncAdaptor::Error);
return;
}
#endif

setStatus(SocialNetworkSyncAdaptor::Busy);
updateDataForAccount(accountId);
Expand Down Expand Up @@ -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()));
Expand Down

0 comments on commit f09e294

Please sign in to comment.