[Facebook] Only mark as connected if user id is received

Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
This commit is contained in:
Tomaz Canabrava 2017-09-29 12:22:33 +02:00 committed by Dirk Hohndel
parent a6aeaf897a
commit 2db4f626ed

View file

@ -91,7 +91,6 @@ void FacebookManager::tryLogin(const QUrl& loginResponse)
auto fb = SettingsObjectWrapper::instance()->facebook;
fb->setAccessToken(securityToken);
requestUserId();
emit justLoggedIn(true);
}
void FacebookManager::logout()
@ -170,8 +169,9 @@ void FacebookManager::userIdReceived()
QNetworkReply *reply = qobject_cast<QNetworkReply*>(sender());
QJsonDocument jsonDoc = QJsonDocument::fromJson(reply->readAll());
QJsonObject obj = jsonDoc.object();
if (obj.keys().contains("id")){
if (obj.keys().contains("id")) {
SettingsObjectWrapper::instance()->facebook->setUserId(obj.value("id").toString());
emit justLoggedIn(true);
}
reply->deleteLater();
}