libpurple/protocols/mxit/chunk.c

branch
mxit
changeset 30788
da428f8d1f97
parent 29106
51c7b2177e42
child 31496
32788a58721b
equal deleted inserted replaced
30787:daf5f929531c 30788:da428f8d1f97
404 * Encode a "get avatar" chunk. (Chunk type 14) 404 * Encode a "get avatar" chunk. (Chunk type 14)
405 * 405 *
406 * @param chunkdata Chunked-data buffer 406 * @param chunkdata Chunked-data buffer
407 * @param mxitId The username who's avatar to download 407 * @param mxitId The username who's avatar to download
408 * @param avatarId The Id of the avatar image (as string) 408 * @param avatarId The Id of the avatar image (as string)
409 * @param imgsize The resolution of the avatar image
410 * @return The number of bytes encoded in the buffer 409 * @return The number of bytes encoded in the buffer
411 */ 410 */
412 int mxit_chunk_create_get_avatar( char* chunkdata, const char* mxitId, const char* avatarId, unsigned int imgsize ) 411 int mxit_chunk_create_get_avatar( char* chunkdata, const char* mxitId, const char* avatarId )
413 { 412 {
414 int pos = 0; 413 int pos = 0;
415 414
416 /* number of avatars [4 bytes] */ 415 /* number of avatars [4 bytes] */
417 pos += add_int32( &chunkdata[pos], 1 ); 416 pos += add_int32( &chunkdata[pos], 1 );
430 429
431 /* number of sizes [2 bytes] */ 430 /* number of sizes [2 bytes] */
432 pos += add_int16( &chunkdata[pos], 1 ); 431 pos += add_int16( &chunkdata[pos], 1 );
433 432
434 /* image size [4 bytes] */ 433 /* image size [4 bytes] */
435 pos += add_int32( &chunkdata[pos], imgsize ); 434 pos += add_int32( &chunkdata[pos], MXIT_AVATAR_SIZE );
436 435
437 return pos; 436 return pos;
438 } 437 }
439 438
440 439

mercurial