diff options
author | Dirk Hohndel <dirk@hohndel.org> | 2015-02-01 10:52:28 -0800 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2015-02-01 10:52:28 -0800 |
commit | 62bc751bd900232ed6dc1ae8269f9f889531c0d9 (patch) | |
tree | 01db795156d44ce885fa907afa61552ea54f42a9 | |
parent | f30ff4fde73ac7526294b33c17da2f24fcd56d5d (diff) | |
download | subsurface-62bc751bd900232ed6dc1ae8269f9f889531c0d9.tar.gz |
Facebook integration: recognize when user didn't allow us to post
Why someone would log in but then not allow us to post I don't know... but
it seems useful to at least handle it...
Signed-off-by: Dirk Hohndel <dirk@hohndel.org>
-rw-r--r-- | qt-ui/socialnetworks.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/qt-ui/socialnetworks.cpp b/qt-ui/socialnetworks.cpp index 576fe42e2..21ccf9354 100644 --- a/qt-ui/socialnetworks.cpp +++ b/qt-ui/socialnetworks.cpp @@ -45,7 +45,7 @@ QUrl FacebookManager::connectUrl() { return QUrl("https://www.facebook.com/dialog/oauth?" "client_id=427722490709000" "&redirect_uri=http://www.facebook.com/connect/login_success.html" - "&response_type=token" + "&response_type=token,granted_scopes" "&display=popup" "&scope=publish_actions,user_photos" ); @@ -75,6 +75,10 @@ void FacebookManager::tryLogin(const QUrl& loginResponse) if (!result.contains("access_token")) return; + if (result.contains("denied_scopes=publish_actions") || result.contains("denied_scopes=user_photos")) { + qDebug() << "user did not allow us access" << result; + return; + } int from = result.indexOf("access_token=") + strlen("access_token="); int to = result.indexOf("&expires_in"); QString securityToken = result.mid(from, to-from); |