diff options
author | Alexandre Erwin Ittner <alexandre@ittner.com.br> | 2014-09-25 22:03:36 -0300 |
---|---|---|
committer | Alexandre Erwin Ittner <alexandre@ittner.com.br> | 2014-09-25 22:03:36 -0300 |
commit | c17fc040a4087c33cc5004038adc15f67aa7d9ae (patch) | |
tree | 98842fa915ec4666cc2e4dc8eafdb82bebc05541 /docs | |
parent | d2640103649b4513d2fc4d7bbb291fa941023ebf (diff) |
Update avatar documentation
Update the documentation to reflect the API changes introduced by
commits 21be438b2b3f7aa1b65b76a7f528eacfe5b634db and
d409bad30dd1657f6b54ea5e38a4d9155f718ae1
Diffstat (limited to 'docs')
-rw-r--r-- | docs/Avatars.md | 17 |
1 files changed, 8 insertions, 9 deletions
diff --git a/docs/Avatars.md b/docs/Avatars.md index fee401c0..75517004 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. */ |
147 | int tox_get_self_avatar(const Tox *tox, uint8_t *format, uint8_t *buf, uint32_t *length, uint32_t maxlen, uint8_t *hash); | 147 | int 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). */ |
150 | int tox_avatar_hash(const Tox *tox, uint8_t *hash, const uint8_t *data, const uint32_t datalen); | 150 | int 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. */ |
153 | int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber); | 153 | int tox_request_avatar_info(const Tox *tox, const int32_t friendnumber); |
@@ -332,7 +332,7 @@ As in this example: | |||
332 | printf("Receiving avatar information from friend %d. Format = %d\n", | 332 | printf("Receiving avatar information from friend %d. Format = %d\n", |
333 | friendnumber, format); | 333 | friendnumber, format); |
334 | printf("Data hash: "); | 334 | printf("Data hash: "); |
335 | hex_printf(hash, TOX_AVATAR_HASH_LENGTH); /* Hypothetical function */ | 335 | hex_printf(hash, TOX_HASH_LENGTH); /* Hypothetical function */ |
336 | printf("\n"); | 336 | printf("\n"); |
337 | } | 337 | } |
338 | 338 | ||
@@ -592,11 +592,10 @@ The present proposal mitigates this situation by: | |||
592 | avatar information when nothing has changed (`PACKET_ID_AVATAR_INFO`); | 592 | avatar information when nothing has changed (`PACKET_ID_AVATAR_INFO`); |
593 | 593 | ||
594 | - Having per-friend data transfer limit. As the current protocol still | 594 | - Having per-friend data transfer limit. As the current protocol still |
595 | allows an user to request an infinite data stream by asking the the | 595 | allows an user to request avatar data again and again, the implementation |
596 | same offset of the avatar again and again, the implementation limits | 596 | limits the amount of data a particular user can request for some time. The |
597 | the amount of data a single user can request for some time. For now, | 597 | exact values are defined in constants `AVATAR_DATA_TRANSFER_LIMIT` and |
598 | the library will not allow an user to request more than | 598 | `AVATAR_DATA_TRANSFER_TIMEOUT` in file `Messenger.c`. |
599 | `10*TOX_AVATAR_MAX_DATA_LENGTH` in less than 20 minutes; | ||
600 | 599 | ||
601 | - Making the requester responsible for storing partial data and state | 600 | - Making the requester responsible for storing partial data and state |
602 | information; | 601 | information; |