comparison src/protocols/jabber/buddy.c @ 10687:b256ce6b85b8

[gaim-migrate @ 12235] grim says this is really fixed this time. committer: Tailor Script <tailor@pidgin.im>
author Etan Reisner <pidgin@unreliablesource.net>
date Sat, 12 Mar 2005 01:10:37 +0000
parents 72a5babfa8b4
children cef48e318125
comparison
equal deleted inserted replaced
10686:212946f774c0 10687:b256ce6b85b8
392 392
393 photo = xmlnode_new_child(vc_node, "PHOTO"); 393 photo = xmlnode_new_child(vc_node, "PHOTO");
394 enc = gaim_base64_encode(avatar_data, avatar_len); 394 enc = gaim_base64_encode(avatar_data, avatar_len);
395 395
396 gaim_cipher_digest_region("sha1", (guint8 *)avatar_data, 396 gaim_cipher_digest_region("sha1", (guint8 *)avatar_data,
397 avatar_len, hashval, NULL); 397 avatar_len, sizeof(hashval),
398 hashval, NULL);
398 399
399 p = hash; 400 p = hash;
400 for(i=0; i<20; i++, p+=2) 401 for(i=0; i<20; i++, p+=2)
401 snprintf(p, 3, "%02x", hashval[i]); 402 snprintf(p, 3, "%02x", hashval[i]);
402 js->avatar_hash = g_strdup(hash); 403 js->avatar_hash = g_strdup(hash);
818 819
819 gaim_buddy_icons_set_for_user(js->gc->account, bare_jid, 820 gaim_buddy_icons_set_for_user(js->gc->account, bare_jid,
820 data, size); 821 data, size);
821 822
822 gaim_cipher_digest_region("sha1", (guint8 *)data, size, 823 gaim_cipher_digest_region("sha1", (guint8 *)data, size,
823 hashval, NULL); 824 sizeof(hashval), hashval, NULL);
824 p = hash; 825 p = hash;
825 for(i=0; i<20; i++, p+=2) 826 for(i=0; i<20; i++, p+=2)
826 snprintf(p, 3, "%02x", hashval[i]); 827 snprintf(p, 3, "%02x", hashval[i]);
827 gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash); 828 gaim_blist_node_set_string((GaimBlistNode*)b, "avatar_hash", hash);
828 829