diff options
author | aunsane <aunsane@gmail.com> | 2017-12-09 23:39:16 +0300 |
---|---|---|
committer | aunsane <aunsane@gmail.com> | 2017-12-09 23:39:16 +0300 |
commit | 6d27acd0a57bc6a228f1b6dd2ce451c02cc7419c (patch) | |
tree | a82b4c833eb6cec7ec81942d611ae708c0da0702 /plugins/CloudFile/src/file_transfer.h | |
parent | 15d04b366b37563254f914a41db97646730514b9 (diff) |
CloudFile: realized MS_DROPBOX_UPLOAD
Diffstat (limited to 'plugins/CloudFile/src/file_transfer.h')
-rw-r--r-- | plugins/CloudFile/src/file_transfer.h | 27 |
1 files changed, 23 insertions, 4 deletions
diff --git a/plugins/CloudFile/src/file_transfer.h b/plugins/CloudFile/src/file_transfer.h index cdf4475aeb..cbe928eda9 100644 --- a/plugins/CloudFile/src/file_transfer.h +++ b/plugins/CloudFile/src/file_transfer.h @@ -12,6 +12,8 @@ private: bool isTerminated; + CMStringW serverFolder; + const wchar_t* folderName; int relativePathStart; @@ -85,6 +87,19 @@ public: isTerminated = true; } + void SetServerFolder(const wchar_t *path) + { + if (path) + serverFolder = path; + } + + const wchar_t* GetServerFolder() const + { + if (serverFolder.IsEmpty()) + return NULL; + return serverFolder; + } + void SetWorkingDirectory(const wchar_t *path) { relativePathStart = wcsrchr(path, '\\') - path + 1; @@ -193,7 +208,8 @@ public: { pfts.currentFileProgress += count; pfts.totalProgress += count; - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); + if (pfts.hContact) + ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); } void FirstFile() @@ -203,7 +219,8 @@ public: pfts.currentFileNumber = 0; pfts.currentFileProgress = 0; pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1; - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); + if (pfts.hContact) + ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_DATA, (HANDLE)id, (LPARAM)&pfts); OpenCurrentFile(); CheckCurrentFile(); @@ -218,7 +235,8 @@ public: pfts.currentFileProgress = 0; pfts.tszCurrentFile = wcsrchr(pfts.ptszFiles[pfts.currentFileNumber], '\\') + 1; - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0); + if (pfts.hContact) + ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, ACKRESULT_NEXTFILE, (HANDLE)id, 0); OpenCurrentFile(); CheckCurrentFile(); @@ -228,7 +246,8 @@ public: void SetStatus(int status, LPARAM param = 0) { - ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, status, (HANDLE)id, param); + if (pfts.hContact) + ProtoBroadcastAck(MODULE, pfts.hContact, ACKTYPE_FILE, status, (HANDLE)id, param); } }; |