diff options
Diffstat (limited to 'toxcore/tox.c')
-rw-r--r-- | toxcore/tox.c | 105 |
1 files changed, 51 insertions, 54 deletions
diff --git a/toxcore/tox.c b/toxcore/tox.c index c5bea846..b44f0ee6 100644 --- a/toxcore/tox.c +++ b/toxcore/tox.c | |||
@@ -275,42 +275,6 @@ uint8_t tox_get_self_user_status(const Tox *tox) | |||
275 | return m_get_self_userstatus(m); | 275 | return m_get_self_userstatus(m); |
276 | } | 276 | } |
277 | 277 | ||
278 | int tox_set_avatar(Tox *tox, uint8_t format, const uint8_t *data, uint32_t length) | ||
279 | { | ||
280 | Messenger *m = tox; | ||
281 | return m_set_avatar(m, format, data, length); | ||
282 | } | ||
283 | |||
284 | int tox_get_self_avatar(const Tox *tox, uint8_t *format, uint8_t *buf, uint32_t *length, uint32_t maxlen, uint8_t *hash) | ||
285 | { | ||
286 | const Messenger *m = tox; | ||
287 | return m_get_self_avatar(m, format, buf, length, maxlen, hash); | ||
288 | } | ||
289 | |||
290 | int tox_avatar_hash(const Tox *tox, uint8_t *hash, const uint8_t *data, const uint32_t datalen) | ||
291 | { | ||
292 | return m_avatar_hash(hash, data, datalen); | ||
293 | } | ||
294 | |||
295 | int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber) | ||
296 | { | ||
297 | const Messenger *m = tox; | ||
298 | return m_request_avatar_info(m, friendnumber); | ||
299 | } | ||
300 | |||
301 | int tox_send_avatar_info(Tox *tox, const int32_t friendnumber) | ||
302 | { | ||
303 | const Messenger *m = tox; | ||
304 | return m_send_avatar_info(m, friendnumber); | ||
305 | } | ||
306 | |||
307 | int tox_request_avatar_data(const Tox *tox, const int32_t friendnumber) | ||
308 | { | ||
309 | const Messenger *m = tox; | ||
310 | return m_request_avatar_data(m, friendnumber); | ||
311 | } | ||
312 | |||
313 | |||
314 | /* returns timestamp of last time friendnumber was seen online, or 0 if never seen. | 278 | /* returns timestamp of last time friendnumber was seen online, or 0 if never seen. |
315 | * returns -1 on error. | 279 | * returns -1 on error. |
316 | */ | 280 | */ |
@@ -475,24 +439,6 @@ void tox_callback_connection_status(Tox *tox, void (*function)(Messenger *tox, i | |||
475 | m_callback_connectionstatus(m, function, userdata); | 439 | m_callback_connectionstatus(m, function, userdata); |
476 | } | 440 | } |
477 | 441 | ||
478 | void tox_callback_avatar_info(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, void *), void *userdata) | ||
479 | { | ||
480 | Messenger *m = tox; | ||
481 | m_callback_avatar_info(m, function, userdata); | ||
482 | } | ||
483 | |||
484 | |||
485 | void tox_callback_avatar_data(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, uint8_t *, uint32_t, | ||
486 | void *), void *userdata) | ||
487 | { | ||
488 | Messenger *m = tox; | ||
489 | m_callback_avatar_data(m, function, userdata); | ||
490 | } | ||
491 | |||
492 | |||
493 | |||
494 | |||
495 | |||
496 | /**********ADVANCED FUNCTIONS (If you don't know what they do you can safely ignore them.) ************/ | 442 | /**********ADVANCED FUNCTIONS (If you don't know what they do you can safely ignore them.) ************/ |
497 | 443 | ||
498 | /* Functions to get/set the nospam part of the id. | 444 | /* Functions to get/set the nospam part of the id. |
@@ -852,6 +798,57 @@ uint64_t tox_file_data_remaining(const Tox *tox, int32_t friendnumber, uint8_t f | |||
852 | return file_dataremaining(m, friendnumber, filenumber, send_receive); | 798 | return file_dataremaining(m, friendnumber, filenumber, send_receive); |
853 | } | 799 | } |
854 | 800 | ||
801 | |||
802 | /****************AVATAR FUNCTIONS*****************/ | ||
803 | |||
804 | void tox_callback_avatar_info(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, void *), void *userdata) | ||
805 | { | ||
806 | Messenger *m = tox; | ||
807 | m_callback_avatar_info(m, function, userdata); | ||
808 | } | ||
809 | |||
810 | void tox_callback_avatar_data(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, uint8_t *, uint32_t, | ||
811 | void *), void *userdata) | ||
812 | { | ||
813 | Messenger *m = tox; | ||
814 | m_callback_avatar_data(m, function, userdata); | ||
815 | } | ||
816 | |||
817 | int tox_set_avatar(Tox *tox, uint8_t format, const uint8_t *data, uint32_t length) | ||
818 | { | ||
819 | Messenger *m = tox; | ||
820 | return m_set_avatar(m, format, data, length); | ||
821 | } | ||
822 | |||
823 | int tox_get_self_avatar(const Tox *tox, uint8_t *format, uint8_t *buf, uint32_t *length, uint32_t maxlen, uint8_t *hash) | ||
824 | { | ||
825 | const Messenger *m = tox; | ||
826 | return m_get_self_avatar(m, format, buf, length, maxlen, hash); | ||
827 | } | ||
828 | |||
829 | int tox_avatar_hash(const Tox *tox, uint8_t *hash, const uint8_t *data, const uint32_t datalen) | ||
830 | { | ||
831 | return m_avatar_hash(hash, data, datalen); | ||
832 | } | ||
833 | |||
834 | int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber) | ||
835 | { | ||
836 | const Messenger *m = tox; | ||
837 | return m_request_avatar_info(m, friendnumber); | ||
838 | } | ||
839 | |||
840 | int tox_send_avatar_info(Tox *tox, const int32_t friendnumber) | ||
841 | { | ||
842 | const Messenger *m = tox; | ||
843 | return m_send_avatar_info(m, friendnumber); | ||
844 | } | ||
845 | |||
846 | int tox_request_avatar_data(const Tox *tox, const int32_t friendnumber) | ||
847 | { | ||
848 | const Messenger *m = tox; | ||
849 | return m_request_avatar_data(m, friendnumber); | ||
850 | } | ||
851 | |||
855 | /***************END OF FILE SENDING FUNCTIONS******************/ | 852 | /***************END OF FILE SENDING FUNCTIONS******************/ |
856 | 853 | ||
857 | /* Like tox_bootstrap_from_address but for TCP relays only. | 854 | /* Like tox_bootstrap_from_address but for TCP relays only. |