From e5287627d957b092d11ba8031e4d30dc7f79cbd5 Mon Sep 17 00:00:00 2001 From: Alexander Lantsev Date: Thu, 3 Mar 2016 15:43:38 +0000 Subject: Dropbox: fallback to v1 api to support shorten urls git-svn-id: http://svn.miranda-ng.org/main/trunk@16406 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c --- plugins/Dropbox/src/dropbox_transfers.cpp | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) (limited to 'plugins/Dropbox/src/dropbox_transfers.cpp') diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index 801f2e344e..15fd919598 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -76,9 +76,14 @@ void CDropbox::CreateFolder(const char *path) void CDropbox::CreateDownloadUrl(const char *path, char *url) { ptrA token(db_get_sa(NULL, MODULE, "TokenSecret")); - //bool useShortUrl = db_get_b(NULL, MODULE, "UseSortLinks", 1) > 0; - ShareRequest request(token, path); - NLHR_PTR response(request.Send(hNetlibConnection)); + bool useShortUrl = db_get_b(NULL, MODULE, "UseSortLinks", 1) > 0; + HttpRequest *request; + if (useShortUrl) + request = new ShareOldRequest(token, path); + else + request = new ShareRequest(token, path); + NLHR_PTR response(request->Send(hNetlibConnection)); + delete request; HandleJsonResponseError(response); -- cgit v1.2.3