diff options
author | Alexander Lantsev <aunsane@gmail.com> | 2014-08-25 18:32:33 +0000 |
---|---|---|
committer | Alexander Lantsev <aunsane@gmail.com> | 2014-08-25 18:32:33 +0000 |
commit | 0a776a22a99c20a23763aac28209a00a36126b7b (patch) | |
tree | 57f77054ea993310d92c54448f2896d008a9800c /protocols/Tox/src/tox_transfers.cpp | |
parent | 9afd590f4fd860d3d023203137129c8870bb8579 (diff) |
Tox:
- updated tox core
- fixdd contacts adding
- some code for file sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@10320 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_transfers.cpp')
-rw-r--r-- | protocols/Tox/src/tox_transfers.cpp | 27 |
1 files changed, 27 insertions, 0 deletions
diff --git a/protocols/Tox/src/tox_transfers.cpp b/protocols/Tox/src/tox_transfers.cpp new file mode 100644 index 0000000000..b15ac1838f --- /dev/null +++ b/protocols/Tox/src/tox_transfers.cpp @@ -0,0 +1,27 @@ +#include "common.h"
+
+int CToxProto::FileSendQueueCompare(const CFile* p1, const CFile* p2)
+{
+ return 0;
+}
+
+void CToxProto::SendFilesAsync(void* arg)
+{
+ CFileTransfer *ftp = (CFileTransfer*)arg;
+
+ std::string toxId(getStringA(ftp->pfts.hContact, TOX_SETTINGS_ID));
+ std::vector<uint8_t> clientId = HexStringToData(toxId);
+
+ uint32_t number = tox_get_friend_number(tox, clientId.data());
+
+ for (int i = 0; ftp->GetFileCount(); i++)
+ {
+ CFile *file = ftp->GetFileAt(i);
+ int hFile = tox_new_file_sender(tox, number, file->GetSize(), (uint8_t*)file->GetName(), strlen(file->GetName()));
+ if (hFile < 0)
+ {
+ debugLogA("CToxProto::SendFilesAsync: cannot send file");
+ }
+ file->SetHandle((HANDLE)hFile);
+ }
+}
\ No newline at end of file |