diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-04-24 11:55:06 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-04-24 11:55:06 +0000 |
commit | 79812b0325d58e7954d4aec16aa8dddfec9c5479 (patch) | |
tree | 14f43bbd89d64e1dd5190694cbb31d67950b0065 /plugins/Dropbox | |
parent | 2c31feb35459e84ac1964030ba46e90038601436 (diff) |
Dropbox: fix auth flow
git-svn-id: http://svn.miranda-ng.org/main/trunk@16759 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox')
-rw-r--r-- | plugins/Dropbox/src/dropbox.cpp | 6 | ||||
-rw-r--r-- | plugins/Dropbox/src/stdafx.h | 10 |
2 files changed, 8 insertions, 8 deletions
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp index 907986095e..954e9191c4 100644 --- a/plugins/Dropbox/src/dropbox.cpp +++ b/plugins/Dropbox/src/dropbox.cpp @@ -90,8 +90,8 @@ void CDropbox::RequestAccountInfo(void *p) JSONNode name = root.at("name");
if (!name.empty()) {
- db_set_ts(hContact, MODULE, "FirstName", ptrT(mir_utf8decodeT(name.at("given_name").as_string().c_str())));
- db_set_ts(hContact, MODULE, "LastName", ptrT(mir_utf8decodeT(name.at("surname").as_string().c_str())));
+ db_set_utf(hContact, MODULE, "FirstName", name.at("given_name").as_string().c_str());
+ db_set_utf(hContact, MODULE, "LastName", name.at("surname").as_string().c_str());
}
JSONNode country = root.at("country");
@@ -151,7 +151,7 @@ UINT CDropbox::RequestAccessTokenAsync(void *owner, void *param) GetAccessTokenRequest request(requestToken);
NLHR_PTR response(request.Send(instance->hNetlibConnection));
- if (response == NULL) {
+ if (response == NULL || response->resultCode != HTTP_STATUS_OK) {
Netlib_Logf(instance->hNetlibConnection, "%s: %s", MODULE, HttpStatusToText(HTTP_STATUS_ERROR));
if (hwndDlg)
SetDlgItemText(hwndDlg, IDC_AUTH_STATUS, TranslateT("server does not respond"));
diff --git a/plugins/Dropbox/src/stdafx.h b/plugins/Dropbox/src/stdafx.h index 06c01db459..7f0cdb079f 100644 --- a/plugins/Dropbox/src/stdafx.h +++ b/plugins/Dropbox/src/stdafx.h @@ -38,12 +38,12 @@ class CDropbox;
-#define DROPBOX_API_VER "2"
-#define DROPBOX_WWW_URL "https://www.dropbox.com/1"
-#define DROPBOX_API_OLD "https://api.dropboxapi.com/1"
-#define DROPBOX_API "https://api.dropboxapi.com/"
+#define DROPBOX_API_VER "/2"
+#define DROPBOX_WWW_URL "https://www.dropbox.com"
+#define DROPBOX_API "https://api.dropboxapi.com"
#define DROPBOX_API_RPC DROPBOX_API DROPBOX_API_VER
-#define DROPBOX_API_CU "https://content.dropboxapi.com/" DROPBOX_API_VER
+#define DROPBOX_CONTENT "https://content.dropboxapi.com"
+#define DROPBOX_API_CU DROPBOX_CONTENT DROPBOX_API_VER
#define DROPBOX_APP_KEY "fa8du7gkf2q8xzg"
#include "..\..\..\miranda-private-keys\Dropbox\secret_key.h"
|