comparison libpurple/protocols/jabber/buddy.c @ 32299:fa183182bc2b

Update js->initial_avatar_hash if the user tries to set the icon before we've received our self vcard. This is the other half of a fix to get rid of a race condition where the user's icon wouldn't get set correctly if they set it while connecting.
author Mark Doliner <mark@kingant.net>
date Wed, 13 Apr 2011 00:22:29 +0000
parents 515ed916e691
children fec20ae8373a
comparison
equal deleted inserted replaced
32298:515ed916e691 32299:fa183182bc2b
465 xmlnode *vc_node; 465 xmlnode *vc_node;
466 const struct tag_attr *tag_attr; 466 const struct tag_attr *tag_attr;
467 467
468 /* if we haven't grabbed the remote vcard yet, we can't 468 /* if we haven't grabbed the remote vcard yet, we can't
469 * assume that what we have here is correct */ 469 * assume that what we have here is correct */
470 if(!js->vcard_fetched) 470 if(!js->vcard_fetched) {
471 PurpleStoredImage *image;
472 g_free(js->initial_avatar_hash);
473 image = purple_buddy_icons_find_account_icon(purple_connection_get_account(gc));
474 if (image != NULL) {
475 js->initial_avatar_hash =
476 jabber_calculate_data_hash(purple_imgstore_get_data(image),
477 purple_imgstore_get_size(image), "sha1");
478 purple_imgstore_unref(image);
479 } else {
480 js->initial_avatar_hash = NULL;
481 }
471 return; 482 return;
483 }
472 484
473 if (js->vcard_timer) { 485 if (js->vcard_timer) {
474 purple_timeout_remove(js->vcard_timer); 486 purple_timeout_remove(js->vcard_timer);
475 js->vcard_timer = 0; 487 js->vcard_timer = 0;
476 } 488 }