diff options
Diffstat (limited to 'toxcore/Messenger.h')
-rw-r--r-- | toxcore/Messenger.h | 14 |
1 files changed, 8 insertions, 6 deletions
diff --git a/toxcore/Messenger.h b/toxcore/Messenger.h index ca99fa18..8ca93153 100644 --- a/toxcore/Messenger.h +++ b/toxcore/Messenger.h | |||
@@ -102,7 +102,7 @@ USERSTATUS; | |||
102 | struct File_Transfers { | 102 | struct File_Transfers { |
103 | uint64_t size; | 103 | uint64_t size; |
104 | uint64_t transferred; | 104 | uint64_t transferred; |
105 | uint8_t status; /* 0 == no transfer, 1 = not accepted, 2 = paused, 3 = transferring, 4 = broken*/ | 105 | uint8_t status; /* 0 == no transfer, 1 = not accepted, 2 = paused by the other, 3 = transferring, 4 = broken, 5 = paused by us */ |
106 | }; | 106 | }; |
107 | 107 | ||
108 | /* This cannot be bigger than 256 */ | 108 | /* This cannot be bigger than 256 */ |
@@ -186,7 +186,7 @@ typedef struct Messenger { | |||
186 | 186 | ||
187 | void (*file_sendrequest)(struct Messenger *m, int, uint8_t, uint64_t, uint8_t *, uint16_t, void *); | 187 | void (*file_sendrequest)(struct Messenger *m, int, uint8_t, uint64_t, uint8_t *, uint16_t, void *); |
188 | void *file_sendrequest_userdata; | 188 | void *file_sendrequest_userdata; |
189 | void (*file_filecontrol)(struct Messenger *m, int, uint8_t, uint8_t, uint8_t *, uint16_t, void *); | 189 | void (*file_filecontrol)(struct Messenger *m, int, uint8_t, uint8_t, uint8_t, uint8_t *, uint16_t, void *); |
190 | void *file_filecontrol_userdata; | 190 | void *file_filecontrol_userdata; |
191 | void (*file_filedata)(struct Messenger *m, int, uint8_t, uint8_t *, uint16_t length, void *); | 191 | void (*file_filedata)(struct Messenger *m, int, uint8_t, uint8_t *, uint16_t length, void *); |
192 | void *file_filedata_userdata; | 192 | void *file_filedata_userdata; |
@@ -480,10 +480,11 @@ void callback_file_sendrequest(Messenger *m, void (*function)(Messenger *m, int, | |||
480 | 480 | ||
481 | /* Set the callback for file control requests. | 481 | /* Set the callback for file control requests. |
482 | * | 482 | * |
483 | * Function(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t control_type, uint8_t *data, uint16_t length, void *userdata) | 483 | * Function(Tox *tox, int friendnumber, uint8_t send_receive, uint8_t filenumber, uint8_t control_type, uint8_t *data, uint16_t length, void *userdata) |
484 | * | 484 | * |
485 | */ | 485 | */ |
486 | void callback_file_control(Messenger *m, void (*function)(Messenger *m, int, uint8_t, uint8_t, uint8_t *, uint16_t, | 486 | void callback_file_control(Messenger *m, void (*function)(Messenger *m, int, uint8_t, uint8_t, uint8_t, uint8_t *, |
487 | uint16_t, | ||
487 | void *), void *userdata); | 488 | void *), void *userdata); |
488 | 489 | ||
489 | /* Set the callback for file data. | 490 | /* Set the callback for file data. |
@@ -510,12 +511,13 @@ int file_sendrequest(Messenger *m, int friendnumber, uint8_t filenumber, uint64_ | |||
510 | int new_filesender(Messenger *m, int friendnumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length); | 511 | int new_filesender(Messenger *m, int friendnumber, uint64_t filesize, uint8_t *filename, uint16_t filename_length); |
511 | 512 | ||
512 | /* Send a file control request. | 513 | /* Send a file control request. |
514 | * send_receive is 0 if we want the control packet to target a sending file, 1 if it targets a receiving file. | ||
513 | * | 515 | * |
514 | * return 1 on success | 516 | * return 1 on success |
515 | * return 0 on failure | 517 | * return 0 on failure |
516 | */ | 518 | */ |
517 | int file_control(Messenger *m, int friendnumber, uint8_t filenumber, uint8_t message_id, uint8_t *data, | 519 | int file_control(Messenger *m, int friendnumber, uint8_t send_receive, uint8_t filenumber, uint8_t message_id, |
518 | uint16_t length); | 520 | uint8_t *data, uint16_t length); |
519 | 521 | ||
520 | /* Send file data. | 522 | /* Send file data. |
521 | * | 523 | * |