summaryrefslogtreecommitdiff
path: root/plugins/CloudFile/src/file_transfer.h
diff options
context:
space:
mode:
authoraunsane <aunsane@gmail.com>2018-02-24 01:15:27 +0300
committeraunsane <aunsane@gmail.com>2018-02-24 01:15:27 +0300
commit1785dc55c0a4cdcbc5f9788e0196e7d3a38fe53c (patch)
tree3c9fb0a2d27504f14e1ef9ffe43e2d58f4ea1085 /plugins/CloudFile/src/file_transfer.h
parent3f343c22a352462660a71806303c1f8957a85702 (diff)
CloudFile: Implement new upload services (#1144)
Diffstat (limited to 'plugins/CloudFile/src/file_transfer.h')
-rw-r--r--plugins/CloudFile/src/file_transfer.h35
1 files changed, 30 insertions, 5 deletions
diff --git a/plugins/CloudFile/src/file_transfer.h b/plugins/CloudFile/src/file_transfer.h
index cbe928eda9..ab83d7db2e 100644
--- a/plugins/CloudFile/src/file_transfer.h
+++ b/plugins/CloudFile/src/file_transfer.h
@@ -18,9 +18,12 @@ private:
int relativePathStart;
CMStringW data;
+ LIST<char> m_links;
+ CMStringW m_description;
public:
FileTransferParam(MCONTACT hContact)
+ : m_links(1)
{
hFile = NULL;
id = InterlockedIncrement(&hFileProcess);
@@ -55,14 +58,15 @@ public:
if (pfts.tszWorkingDir)
mir_free(pfts.tszWorkingDir);
- if (pfts.pszFiles)
- {
+ if (pfts.pszFiles) {
for (int i = 0; pfts.pszFiles[i]; i++)
- {
if (pfts.pszFiles[i]) mir_free(pfts.pszFiles[i]);
- }
mir_free(pfts.pszFiles);
}
+
+ for (auto &link : m_links)
+ mir_free(link);
+ m_links.destroy();
}
ULONG GetId() const
@@ -70,7 +74,7 @@ public:
return id;
}
- MCONTACT GetHContact() const
+ MCONTACT GetContact() const
{
return pfts.hContact;
}
@@ -82,6 +86,17 @@ public:
return data;
}
+ const wchar_t* GetDescription() const
+ {
+ return m_description.GetString();
+ }
+
+ const int GetSharedLinks(const char **result) const
+ {
+ result = (const char**)m_links.getArray();
+ return m_links.getCount();
+ }
+
void Terminate()
{
isTerminated = true;
@@ -100,6 +115,11 @@ public:
return serverFolder;
}
+ void SetDescription(const wchar_t *description)
+ {
+ m_description = description;
+ }
+
void SetWorkingDirectory(const wchar_t *path)
{
relativePathStart = wcsrchr(path, '\\') - path + 1;
@@ -141,6 +161,11 @@ public:
va_end(args);
}
+ void AddSharedLink(const char *url)
+ {
+ m_links.insert(mir_strdup(url));
+ }
+
const wchar_t* GetCurrentFilePath() const
{
return pfts.ptszFiles[pfts.currentFileNumber];