diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2016-03-03 14:47:53 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2016-03-03 14:47:53 +0000 |
commit | 999fdaa2662a1fe8937ec110232a78e87d79bfe7 (patch) | |
tree | 1c3d7c292fa5a54986e266778979c2496bb5a420 /plugins/Dropbox/src/dropbox_transfers.cpp | |
parent | 44223012ce0fa631cc5af6fc588166bccc3a66f6 (diff) |
Dropbox:
- remove menu item and srmm button for intercepted accounts
- removed limitation on single transfer window from menu item and srmm
git-svn-id: http://svn.miranda-ng.org/main/trunk@16405 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins/Dropbox/src/dropbox_transfers.cpp')
-rw-r--r-- | plugins/Dropbox/src/dropbox_transfers.cpp | 22 |
1 files changed, 22 insertions, 0 deletions
diff --git a/plugins/Dropbox/src/dropbox_transfers.cpp b/plugins/Dropbox/src/dropbox_transfers.cpp index 6473a0bcc6..801f2e344e 100644 --- a/plugins/Dropbox/src/dropbox_transfers.cpp +++ b/plugins/Dropbox/src/dropbox_transfers.cpp @@ -60,6 +60,19 @@ char* CDropbox::FinishUploadSession(const char *data, size_t size, const char *s return path;
}
+void CDropbox::CreateFolder(const char *path)
+{
+ ptrA token(db_get_sa(NULL, MODULE, "TokenSecret"));
+ CreateFolderRequest request(token, path);
+ NLHR_PTR response(request.Send(hNetlibConnection));
+
+ // forder exists on server
+ if (response->resultCode == HTTP_STATUS_FORBIDDEN)
+ return;
+
+ HandleJsonResponseError(response);
+}
+
void CDropbox::CreateDownloadUrl(const char *path, char *url)
{
ptrA token(db_get_sa(NULL, MODULE, "TokenSecret"));
@@ -83,6 +96,15 @@ UINT CDropbox::UploadToDropbox(void *owner, void *arg) FileTransferParam *ftp = (FileTransferParam*)arg;
try {
+ const TCHAR *folderName = ftp->GetFolderName();
+ if (folderName) {
+ char path[MAX_PATH], url[MAX_PATH];
+ PreparePath(folderName, path);
+ instance->CreateFolder(path);
+ instance->CreateDownloadUrl(path, url);
+ ftp->AppendFormatData(_T("%s\r\n"), ptrT(mir_utf8decodeT(url)));
+ }
+
ftp->FirstFile();
do
{
|