summaryrefslogtreecommitdiff
path: root/docs/Avatars.md
diff options
context:
space:
mode:
Diffstat (limited to 'docs/Avatars.md')
-rw-r--r--docs/Avatars.md17
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/Avatars.md b/docs/Avatars.md
index 2a34abbe..5c92efe5 100644
--- a/docs/Avatars.md
+++ b/docs/Avatars.md
@@ -128,7 +128,7 @@ complete API documentation is available in `tox.h`.
128 128
129``` 129```
130#define TOX_AVATAR_MAX_DATA_LENGTH 16384 130#define TOX_AVATAR_MAX_DATA_LENGTH 16384
131#define TOX_AVATAR_HASH_LENGTH 32 131#define TOX_HASH_LENGTH 32
132 132
133 133
134/* Data formats for user avatar images */ 134/* Data formats for user avatar images */
@@ -146,8 +146,8 @@ int tox_set_avatar(Tox *tox, uint8_t format, const uint8_t *data, uint32_t lengt
146/* Get avatar data from the current user. */ 146/* Get avatar data from the current user. */
147int tox_get_self_avatar(const Tox *tox, uint8_t *format, uint8_t *buf, uint32_t *length, uint32_t maxlen, uint8_t *hash); 147int tox_get_self_avatar(const Tox *tox, uint8_t *format, uint8_t *buf, uint32_t *length, uint32_t maxlen, uint8_t *hash);
148 148
149/* Generates a cryptographic hash of the given avatar data. */ 149/* Generates a cryptographic hash of the given data (usually a cached avatar). */
150int tox_avatar_hash(const Tox *tox, uint8_t *hash, const uint8_t *data, const uint32_t datalen); 150int tox_hash(uint8_t *hash, const uint8_t *data, const uint32_t datalen);
151 151
152/* Request avatar information from a friend. */ 152/* Request avatar information from a friend. */
153int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber); 153int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber);
@@ -337,7 +337,7 @@ As in this example:
337 printf("Receiving avatar information from friend %d. Format = %d\n", 337 printf("Receiving avatar information from friend %d. Format = %d\n",
338 friendnumber, format); 338 friendnumber, format);
339 printf("Data hash: "); 339 printf("Data hash: ");
340 hex_printf(hash, TOX_AVATAR_HASH_LENGTH); /* Hypothetical function */ 340 hex_printf(hash, TOX_HASH_LENGTH); /* Hypothetical function */
341 printf("\n"); 341 printf("\n");
342 } 342 }
343 343
@@ -597,11 +597,10 @@ The present proposal mitigates this situation by:
597 avatar information when nothing has changed (`PACKET_ID_AVATAR_INFO`); 597 avatar information when nothing has changed (`PACKET_ID_AVATAR_INFO`);
598 598
599 - Having per-friend data transfer limit. As the current protocol still 599 - Having per-friend data transfer limit. As the current protocol still
600 allows an user to request an infinite data stream by asking the the 600 allows an user to request avatar data again and again, the implementation
601 same offset of the avatar again and again, the implementation limits 601 limits the amount of data a particular user can request for some time. The
602 the amount of data a single user can request for some time. For now, 602 exact values are defined in constants `AVATAR_DATA_TRANSFER_LIMIT` and
603 the library will not allow an user to request more than 603 `AVATAR_DATA_TRANSFER_TIMEOUT` in file `Messenger.c`.
604 `10*TOX_AVATAR_MAX_DATA_LENGTH` in less than 20 minutes;
605 604
606 - Making the requester responsible for storing partial data and state 605 - Making the requester responsible for storing partial data and state
607 information; 606 information;