summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/services.cpp
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-03-11 22:59:22 +0300
committeraunsane <aunsane@gmail.com>2018-03-11 22:59:22 +0300
commit8d0758286e5d0220647355a218a4c94f70591e6f (patch)
tree3c03ff78e0300fbd04309183592ba5505921ff2d /plugins/CloudFile/src/services.cpp
parent5532fd4e1374c15c13e203a89b7cd060c7e15499 (diff)
CloudFile: Dropbox OAuth with miranda-ng redirect uri
Diffstat (limited to 'plugins/CloudFile/src/services.cpp')
-rw-r--r--plugins/CloudFile/src/services.cpp30
1 files changed, 11 insertions, 19 deletions
diff --git a/plugins/CloudFile/src/services.cpp b/plugins/CloudFile/src/services.cpp
index 2921296434..80fc88a852 100644
--- a/plugins/CloudFile/src/services.cpp
+++ b/plugins/CloudFile/src/services.cpp
@@ -63,34 +63,26 @@ INT_PTR Upload(WPARAM wParam, LPARAM lParam)
if (service == nullptr)
return 3;
- FileTransferParam *ftp = new FileTransferParam(0);
- ftp->SetWorkingDirectory(uploadData->localPath);
- ftp->SetServerFolder(uploadData->serverFolder);
-
- if (PathIsDirectory(uploadData->localPath))
- {
+ if (PathIsDirectory(uploadData->localPath)) {
// temporary unsupported
- Transfers.remove(ftp);
- delete ftp;
-
- return ACKRESULT_FAILED;
+ return 4;
}
- else
- ftp->AddFile(uploadData->localPath);
- int res = service->Upload(ftp);
+ FileTransferParam ftp(0);
+ ftp.SetWorkingDirectory(uploadData->localPath);
+ ftp.SetServerFolder(uploadData->serverFolder);
+ ftp.AddFile(uploadData->localPath);
+
+ int res = service->Upload(&ftp);
if (res == ACKRESULT_SUCCESS && lParam) {
CFUPLOADRESULT *result = (CFUPLOADRESULT*)lParam;
- const char **links = ftp->GetSharedLinks(result->linkCount);
+ const char **links = ftp.GetSharedLinks(result->linkCount);
result->links = (char**)mir_calloc(sizeof(char*) * result->linkCount);
for (size_t i = 0; i < result->linkCount; i++)
result->links[i] = mir_strdup(links[i]);
- result->description = mir_wstrdup(ftp->GetDescription());
+ result->description = mir_wstrdup(ftp.GetDescription());
}
- Transfers.remove(ftp);
- delete ftp;
-
return res;
}
@@ -123,7 +115,7 @@ void InitializeServices()
pd.type = PROTOTYPE_FILTER;
Proto_RegisterModule(&pd);
- CreateServiceFunction(MODULE PSS_FILE, &CCloudService::SendFileInterceptor);
+ CreateServiceFunction(MODULE PSS_FILE, SendFileInterceptor);
CreateServiceFunction(MS_CLOUDFILE_GETSERVICE, GetService);
CreateServiceFunction(MS_CLOUDFILE_ENUMSERVICES, EnumServices);