summaryrefslogtreecommitdiff
path: root/plugins/Dropbox
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2014-02-19 15:47:46 +0000
committerAlexander Lantsev <aunsane@gmail.com>2014-02-19 15:47:46 +0000
commit92d98c110e4879ce6ef1056e92ae71728f29f564 (patch)
treeb5fd22b154eabd195588d1de88b88796873a9db1 /plugins/Dropbox
parent36df84a13018c6c26e7cd1bb8e093dc54393aed7 (diff)
Dropbox: fixed access request
git-svn-id: http://svn.miranda-ng.org/main/trunk@8180 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox')
-rw-r--r--plugins/Dropbox/src/dropbox.cpp4
-rw-r--r--plugins/Dropbox/src/dropbox_menus.cpp2
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp5
3 files changed, 5 insertions, 6 deletions
diff --git a/plugins/Dropbox/src/dropbox.cpp b/plugins/Dropbox/src/dropbox.cpp
index 35f9a7b832..fa2d5cbc86 100644
--- a/plugins/Dropbox/src/dropbox.cpp
+++ b/plugins/Dropbox/src/dropbox.cpp
@@ -30,10 +30,9 @@ bool CDropbox::HasAccessToken()
void CDropbox::RequestAcceessToken()
{
- ShellExecuteA(NULL, "open", DROPBOX_WWW_URL "/" DROPBOX_API_VER "/oauth2/authorize?response_type=code&client_id=" DROPBOX_API_KEY, NULL, NULL, SW_SHOWDEFAULT);
+ ShellExecuteA(NULL, "open", DROPBOX_WWW_URL DROPBOX_API_VER "/oauth2/authorize?response_type=code&client_id=" DROPBOX_API_KEY, NULL, NULL, SW_SHOWDEFAULT);
char request_token[128] = { 0 };
- //request_token[0] = 0;
if (DialogBoxParam(
g_hInstance,
@@ -110,7 +109,6 @@ void CDropbox::RequestAcceessToken()
void CDropbox::DestroyAcceessToken()
{
-
HttpRequest *request = new HttpRequest(hNetlibUser, REQUEST_POST, DROPBOX_API_URL "/disable_access_token");
//request->SendAsync(&CDropboxProto::AsyncFunc);
NETLIBHTTPREQUEST *response = request->Send();
diff --git a/plugins/Dropbox/src/dropbox_menus.cpp b/plugins/Dropbox/src/dropbox_menus.cpp
index fe20bddf1d..b111e51884 100644
--- a/plugins/Dropbox/src/dropbox_menus.cpp
+++ b/plugins/Dropbox/src/dropbox_menus.cpp
@@ -11,7 +11,7 @@ void CDropbox::InitMenus()
mi.pszService = MODULE"/RequeriedAccess";
mi.ptszName = LPGENT("Requeried access");
mi.position = -201001000 + CMI_API_ACCESS_REQUERIED;
- mi.icolibItem = LoadSkinnedIconHandle(SKINICON_AUTH_REVOKE);
+ mi.icolibItem = LoadSkinnedIconHandle(SKINICON_AUTH_REQUEST);
ContactMenuItems[CMI_API_ACCESS_REQUERIED] = Menu_AddContactMenuItem(&mi);
CreateServiceFunction(mi.pszService, RequeriedApiAccess);
} \ No newline at end of file
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 0524cff1c7..b61f9c54ad 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -72,9 +72,10 @@ INT_PTR CDropbox::SendMessage( WPARAM wParam, LPARAM lParam)
INT_PTR CDropbox::RequeriedApiAccess(WPARAM wParam, LPARAM lParam)
{
int result = MessageBox(NULL, TranslateT("Are you sure you want to requeried access?"), TranslateT("Requeried access"), MB_YESNO | MB_ICONQUESTION);
- if (result == IDYES && g_dropbox->HasAccessToken())
+ if (result == IDYES)
{
- g_dropbox->DestroyAcceessToken();
+ if (HasAccessToken())
+ g_dropbox->DestroyAcceessToken();
g_dropbox->RequestAcceessToken();
}