summaryrefslogtreecommitdiff
path: root/protocols/Tox/src/tox_transfer.h
diff options
context:
space:
mode:
authorAlexander Lantsev <aunsane@gmail.com>2015-02-03 21:39:16 +0000
committerAlexander Lantsev <aunsane@gmail.com>2015-02-03 21:39:16 +0000
commit2d0cbc078494bbf8f70e68fe629710bbaa30b2e8 (patch)
tree06ac10b032a5c98fdbe2a7bec871ff1bffa4b06d /protocols/Tox/src/tox_transfer.h
parentac03d5141169f1522e6b2afd8e56f0c39d4320b7 (diff)
Tox: rewrited file sending
git-svn-id: http://svn.miranda-ng.org/main/trunk@11998 1316c22d-e87f-b044-9b9b-93d7a3e3ba9c
Diffstat (limited to 'protocols/Tox/src/tox_transfer.h')
-rw-r--r--protocols/Tox/src/tox_transfer.h23
1 files changed, 16 insertions, 7 deletions
diff --git a/protocols/Tox/src/tox_transfer.h b/protocols/Tox/src/tox_transfer.h
index 8bc1987bea..13120756fb 100644
--- a/protocols/Tox/src/tox_transfer.h
+++ b/protocols/Tox/src/tox_transfer.h
@@ -47,16 +47,22 @@ struct FileTransferParam
return hFile != NULL;
}
- int Start(Tox *tox)
+ /*void Start(Tox *tox)
{
status = STARTED;
- return tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_ACCEPT, NULL, 0);
+ if (tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_ACCEPT, NULL, 0))
+ {
+ Fail(tox);
+ }
}
- int Resume(Tox *tox)
+ void Resume(Tox *tox)
{
status = STARTED;
- return tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_RESUME_BROKEN, (uint8_t*)&pfts.currentFileProgress, sizeof(pfts.currentFileProgress));
+ if (tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_RESUME_BROKEN, (uint8_t*)&pfts.currentFileProgress, sizeof(pfts.currentFileProgress)) == -1)
+ {
+ Fail(tox);
+ }
}
int Fail(Tox *tox)
@@ -71,11 +77,14 @@ struct FileTransferParam
return tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_KILL, NULL, 0);
}
- int Finish(Tox *tox)
+ void Finish(Tox *tox)
{
status = FINISHED;
- return tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_FINISHED, NULL, 0);
- }
+ if (tox_file_send_control(tox, friendNumber, GetDirection(), fileNumber, TOX_FILECONTROL_FINISHED, NULL, 0))
+ {
+ Fail(tox);
+ }
+ }*/
void Rename(const TCHAR* fileName)
{