summaryrefslogtreecommitdiff
path: root/toxcore
diff options
context:
space:
mode:
authorirungentoo <irungentoo@gmail.com>2014-09-27 21:01:21 -0400
committerirungentoo <irungentoo@gmail.com>2014-09-27 21:01:21 -0400
commit5550cc6f310877e060f8a663881072b2d4d1ee6f (patch)
tree1bdb348d93c84c453161a9e758592ac930fd3152 /toxcore
parent230a65c91fa6e58f32d67cc21547fe507eedaeee (diff)
parentc17fc040a4087c33cc5004038adc15f67aa7d9ae (diff)
Merge branch 'update-avatar-docs' of https://github.com/ittner/toxcore
Diffstat (limited to 'toxcore')
-rw-r--r--toxcore/tox.h12
1 files changed, 6 insertions, 6 deletions
diff --git a/toxcore/tox.h b/toxcore/tox.h
index a271bc60..4cde9455 100644
--- a/toxcore/tox.h
+++ b/toxcore/tox.h
@@ -543,8 +543,8 @@ uint32_t tox_get_chatlist(const Tox *tox, int *out_list, uint32_t list_size);
543 * function(Tox *tox, int32_t friendnumber, uint8_t format, uint8_t *hash, void *userdata) 543 * function(Tox *tox, int32_t friendnumber, uint8_t format, uint8_t *hash, void *userdata)
544 * 544 *
545 * where 'format' is the avatar image format (see TOX_AVATAR_FORMAT) and 'hash' is the hash of 545 * where 'format' is the avatar image format (see TOX_AVATAR_FORMAT) and 'hash' is the hash of
546 * the avatar data for caching purposes and it is exactly TOX_AVATAR_HASH_LENGTH long. If the 546 * the avatar data for caching purposes and it is exactly TOX_HASH_LENGTH long. If the image
547 * image format is NONE, the hash is zeroed. 547 * format is NONE, the hash is zeroed.
548 * 548 *
549 */ 549 */
550void tox_callback_avatar_info(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, void *), 550void tox_callback_avatar_info(Tox *tox, void (*function)(Tox *tox, int32_t, uint8_t, uint8_t *, void *),
@@ -560,12 +560,12 @@ void tox_callback_avatar_info(Tox *tox, void (*function)(Tox *tox, int32_t, uint
560 * 560 *
561 * where 'format' is the avatar image format (see TOX_AVATAR_FORMAT); 'hash' is the 561 * where 'format' is the avatar image format (see TOX_AVATAR_FORMAT); 'hash' is the
562 * locally-calculated cryptographic hash of the avatar data and it is exactly 562 * locally-calculated cryptographic hash of the avatar data and it is exactly
563 * TOX_AVATAR_HASH_LENGTH long; 'data' is the avatar image data and 'datalen' is the length 563 * TOX_HASH_LENGTH long; 'data' is the avatar image data and 'datalen' is the length
564 * of such data. 564 * of such data.
565 * 565 *
566 * If format is NONE, 'data' is NULL, 'datalen' is zero, and the hash is zeroed. The hash is 566 * If format is NONE, 'data' is NULL, 'datalen' is zero, and the hash is zeroed. The hash is
567 * always validated locally with the function tox_avatar_hash and ensured to match the image 567 * always validated locally with the function tox_hash and ensured to match the image data,
568 * data, so this value can be safely used to compare with cached avatars. 568 * so this value can be safely used to compare with cached avatars.
569 * 569 *
570 * WARNING: users MUST treat all avatar image data received from another peer as untrusted and 570 * WARNING: users MUST treat all avatar image data received from another peer as untrusted and
571 * potentially malicious. The library only ensures that the data which arrived is the same the 571 * potentially malicious. The library only ensures that the data which arrived is the same the
@@ -605,7 +605,7 @@ int tox_set_avatar(Tox *tox, uint8_t format, const uint8_t *data, uint32_t lengt
605 * buf - destination buffer to the image data. Must have at least 'maxlen' bytes; 605 * buf - destination buffer to the image data. Must have at least 'maxlen' bytes;
606 * length - destination pointer to the image data length; 606 * length - destination pointer to the image data length;
607 * maxlen - length of the destination buffer 'buf'; 607 * maxlen - length of the destination buffer 'buf';
608 * hash - destination pointer to the avatar hash (it must be exactly TOX_AVATAR_HASH_LENGTH bytes long). 608 * hash - destination pointer to the avatar hash (it must be exactly TOX_HASH_LENGTH bytes long).
609 * 609 *
610 * returns 0 on success; 610 * returns 0 on success;
611 * returns -1 on failure. 611 * returns -1 on failure.