diff options
author | Tomaz Canabrava <tcanabrava@kde.org> | 2017-09-13 11:56:41 +0200 |
---|---|---|
committer | Dirk Hohndel <dirk@hohndel.org> | 2017-09-13 09:36:09 -0700 |
commit | e43a11645759e3a5678c1071e79b2c124d91b736 (patch) | |
tree | 8ad9619cf4f2920d53df6f9f2e7ad0390de28956 /desktop-widgets/plugins/facebook/facebookconnectwidget.cpp | |
parent | 850917d41d7745f6e9d16bc856af4a91ca0518e2 (diff) | |
download | subsurface-e43a11645759e3a5678c1071e79b2c124d91b736.tar.gz |
Facebook support: use the new Graph Api
This is basically a one liner.
Signed-off-by: Tomaz Canabrava <tcanabrava@kde.org>
Diffstat (limited to 'desktop-widgets/plugins/facebook/facebookconnectwidget.cpp')
-rw-r--r-- | desktop-widgets/plugins/facebook/facebookconnectwidget.cpp | 6 |
1 files changed, 4 insertions, 2 deletions
diff --git a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp index e01f2b3fb..83514f032 100644 --- a/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp +++ b/desktop-widgets/plugins/facebook/facebookconnectwidget.cpp @@ -51,6 +51,8 @@ FacebookManager::FacebookManager(QObject *parent) : QObject(parent) { } +static QString graphApi = QStringLiteral("https://graph.facebook.com/v2.10/"); + QUrl FacebookManager::connectUrl() { return QUrl("https://www.facebook.com/dialog/oauth?" "client_id=427722490709000" @@ -178,7 +180,7 @@ void FacebookManager::sendDive() QBuffer buffer(&bytes); buffer.open(QIODevice::WriteOnly); pix.save(&buffer, "PNG"); - QUrl url("https://graph.facebook.com/v2.2/" + QString(prefs.facebook.album_id) + "/photos?" + + QUrl url(graphApi + QString(prefs.facebook.album_id) + "/photos?" + "&access_token=" + QString(prefs.facebook.access_token) + "&source=image" + "&message=" + dialog.text().replace(""", "%22")); @@ -191,7 +193,7 @@ void FacebookManager::sendDive() //according to rfc 1867 we need to put this string here: QByteArray data(QString("--" + bound + "\r\n").toLocal8Bit()); data.append("Content-Disposition: form-data; name=\"action\"\r\n\r\n"); - data.append("https://graph.facebook.com/v2.2/\r\n"); + data.append(graphApi + "\r\n"); data.append("--" + bound + "\r\n"); //according to rfc 1867 data.append("Content-Disposition: form-data; name=\"uploaded\"; filename=\"" + QString::number(qrand()) + ".png\"\r\n"); //name of the input is "uploaded" in my form, next one is a file name. data.append("Content-Type: image/jpeg\r\n\r\n"); //data type |