# HG changeset patch # User Paul Aurich # Date 1258137563 0 # Node ID e14402d6c5e0d39f94937bc81d33111b18a156d7 # Parent 43d5face5d9b1f914db5606be14d333e47a49780 jabber: Go back to not overwriting avatars if there is not one locally set. This isn't quite right yet, because we need to pick up the hash and advertise it in our presence. Fixes #10287. diff -r 43d5face5d9b -r e14402d6c5e0 libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Fri Nov 13 18:34:04 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Fri Nov 13 18:39:23 2009 +0000 @@ -924,7 +924,7 @@ } /* Republish our vcard if the photo is different than the server's */ - if (!purple_strequal(vcard_hash, js->initial_avatar_hash)) { + if (js->initial_avatar_hash && !purple_strequal(vcard_hash, js->initial_avatar_hash)) { /* * Google Talk has developed the behavior that it will not accept * a vcard set in the first 10 seconds (or so) of the connection; diff -r 43d5face5d9b -r e14402d6c5e0 libpurple/protocols/jabber/useravatar.c --- a/libpurple/protocols/jabber/useravatar.c Fri Nov 13 18:34:04 2009 +0000 +++ b/libpurple/protocols/jabber/useravatar.c Fri Nov 13 18:39:23 2009 +0000 @@ -229,7 +229,7 @@ * push our avatar. If the server avatar doesn't match the local one, push * our avatar. */ - if (((!items || !metadata) && js->initial_avatar_hash) || + if ((!items || !metadata) || !purple_strequal(server_hash, js->initial_avatar_hash)) { PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account); jabber_avatar_set(js, img); @@ -240,10 +240,14 @@ void jabber_avatar_fetch_mine(JabberStream *js) { char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); - jabber_pep_request_item(js, jid, NS_AVATAR_0_12_METADATA, NULL, - do_got_own_avatar_0_12_cb); - jabber_pep_request_item(js, jid, NS_AVATAR_1_1_METADATA, NULL, - do_got_own_avatar_cb); + + if (js->initial_avatar_hash) { + jabber_pep_request_item(js, jid, NS_AVATAR_0_12_METADATA, NULL, + do_got_own_avatar_0_12_cb); + jabber_pep_request_item(js, jid, NS_AVATAR_1_1_METADATA, NULL, + do_got_own_avatar_cb); + } + g_free(jid); }