summaryrefslogtreecommitdiff
path: root/plugins
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2016-03-05 16:23:54 +0000
committerAlexander Lantsev <aunsane@gmail.com>2016-03-05 16:23:54 +0000
commitabcb6e772b670f0ac54dab0314a2c64217642de8 (patch)
tree68eb49c41e936f49638cc98facf40e6e4be55996 /plugins
parent5452f92d9270cdbb23e9c28a9ea202d73d8d810c (diff)
Dropbox: sync service should return data immediately
git-svn-id: http://svn.miranda-ng.org/main/trunk@16429 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'plugins')
-rw-r--r--plugins/Dropbox/src/dropbox_services.cpp10
-rw-r--r--plugins/ExternalAPI/m_dropbox.h8
2 files changed, 12 insertions, 6 deletions
diff --git a/plugins/Dropbox/src/dropbox_services.cpp b/plugins/Dropbox/src/dropbox_services.cpp
index 56fd7eac72..4666932190 100644
--- a/plugins/Dropbox/src/dropbox_services.cpp
+++ b/plugins/Dropbox/src/dropbox_services.cpp
@@ -161,7 +161,7 @@ INT_PTR CDropbox::ProtoReceiveMessage(WPARAM, LPARAM lParam)
return 0;
}
-INT_PTR CDropbox::UploadToDropbox(WPARAM, LPARAM lParam)
+INT_PTR CDropbox::UploadToDropbox(WPARAM wParam, LPARAM lParam)
{
DropboxUploadInfo *uploadInfo = (DropboxUploadInfo*)lParam;
@@ -177,7 +177,13 @@ INT_PTR CDropbox::UploadToDropbox(WPARAM, LPARAM lParam)
else
ftp->AddFile(uploadInfo->localPath);
- return CDropbox::UploadAndRaiseEvent(this, ftp);
+ int res = UploadToDropbox(this, ftp);
+ if (res == ACKRESULT_SUCCESS && wParam) {
+ char **data = (char**)wParam;
+ *data = mir_utf8encodeT(ftp->GetData());
+ }
+
+ return res;
}
INT_PTR CDropbox::UploadToDropboxAsync(WPARAM, LPARAM lParam)
diff --git a/plugins/ExternalAPI/m_dropbox.h b/plugins/ExternalAPI/m_dropbox.h
index feeb37181b..3d2eacae5e 100644
--- a/plugins/ExternalAPI/m_dropbox.h
+++ b/plugins/ExternalAPI/m_dropbox.h
@@ -8,11 +8,11 @@ struct DropboxUploadInfo
};
// upload file on Dropbox
-// wParam = 0
+// wParam = (WPARAM)(char**) '\r\n' separated download links (can be NULL, otherwise should be manually free)
// lParam = (LPARAM)(const DropboxUploadInfo*)
// returns status of transfer.
// 0 on success otherwise fail
-#define MS_DROPBOX_UPLOAD "Dropbox/Upload"
+#define MS_DROPBOX_UPLOAD "Dropbox/Upload"
// upload file on Dropbox
// wParam = 0
@@ -20,7 +20,7 @@ struct DropboxUploadInfo
// returns file htansfer handle or NULL on failure
// returns immediately, without waiting for the send
// note, that you can track progress by using ME_PROTO_ACK
-#define MS_DROPBOX_UPLOADASYNC "Dropbox/UploadAsync"
+#define MS_DROPBOX_UPLOADASYNC "Dropbox/UploadAsync"
// if you want to get download links after upload
// use ME_DROPBOX_UPLOADED hook. you'll get:
@@ -28,7 +28,7 @@ struct DropboxUploadResult
{
HANDLE hProcess; // hProcess
int status; // status of transfer. 0 on success otherwise fail
- const char* data; // data
+ const char* data; // '\r\n' separated download links
};
// notifies a caller that upload has been finished