diff options
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 13 |
1 files changed, 12 insertions, 1 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index ea19753f..ded2da6d 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -359,7 +359,7 @@ void tox_callback_statusmessage(Tox *tox, void (*function)(Messenger *tox, int, | |||
359 | void tox_callback_userstatus(Tox *tox, void (*_function)(Tox *tox, int, TOX_USERSTATUS, void *), void *userdata) | 359 | void tox_callback_userstatus(Tox *tox, void (*_function)(Tox *tox, int, TOX_USERSTATUS, void *), void *userdata) |
360 | { | 360 | { |
361 | Messenger *m = tox; | 361 | Messenger *m = tox; |
362 | typedef void (*function_type)(Messenger *, int, USERSTATUS, void *); | 362 | typedef void (*function_type)(Messenger *, int, USERSTATUS, void *); |
363 | function_type function = (function_type)_function; | 363 | function_type function = (function_type)_function; |
364 | m_callback_userstatus(m, function, userdata); | 364 | m_callback_userstatus(m, function, userdata); |
365 | } | 365 | } |
@@ -551,6 +551,17 @@ int tox_file_senddata(Tox *tox, int friendnumber, uint8_t filenumber, uint8_t *d | |||
551 | Messenger *m = tox; | 551 | Messenger *m = tox; |
552 | return file_data(m, friendnumber, filenumber, data, length); | 552 | return file_data(m, friendnumber, filenumber, data, length); |
553 | } | 553 | } |
554 | |||
555 | /* Returns the recommended/maximum size of the filedata you send with tox_file_senddata() | ||
556 | * | ||
557 | * return size on success | ||
558 | * return 0 on failure (currently will never return 0) | ||
559 | */ | ||
560 | int tox_filedata_size(Tox *tox, int friendnumber) | ||
561 | { | ||
562 | return MAX_DATA_SIZE - crypto_box_MACBYTES - 3; | ||
563 | } | ||
564 | |||
554 | /* Give the number of bytes left to be sent/received. | 565 | /* Give the number of bytes left to be sent/received. |
555 | * | 566 | * |
556 | * send_receive is 0 if we want the sending files, 1 if we want the receiving. | 567 | * send_receive is 0 if we want the sending files, 1 if we want the receiving. |