From 79812b0325d58e7954d4aec16aa8dddfec9c5479 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Sun, 24 Apr 2016 11:55:06 +0000 Subject: Dropbox: fix auth flow git-svn-id: http://svn.miranda-ng.org/main/trunk@16759 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox.cpp | 6 +++--- plugins/Dropbox/src/stdafx.h | 10 +++++----- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'plugins') 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" -- cgit v1.2.3