diff options
author | Paul Aurich <darkrain42@pidgin.im> | 2009-11-13 18:39:23 +0000 |
---|---|---|
committer | Paul Aurich <darkrain42@pidgin.im> | 2009-11-13 18:39:23 +0000 |
commit | 50d6147c470036db147ae42266bd8122602f0cef (patch) | |
tree | 84cffcfb753ccf858d2981925d2194b2a01dd6eb | |
parent | bfc85cbfb9d8dc9621828c3c7b24094458df781c (diff) | |
download | pidgin-50d6147c470036db147ae42266bd8122602f0cef.tar.gz |
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.
-rw-r--r-- | libpurple/protocols/jabber/buddy.c | 2 | ||||
-rw-r--r-- | libpurple/protocols/jabber/useravatar.c | 14 |
2 files changed, 10 insertions, 6 deletions
diff --git a/libpurple/protocols/jabber/buddy.c b/libpurple/protocols/jabber/buddy.c index c361f76934..48340baaf7 100644 --- a/libpurple/protocols/jabber/buddy.c +++ b/libpurple/protocols/jabber/buddy.c @@ -924,7 +924,7 @@ static void jabber_vcard_save_mine(JabberStream *js, const char *from, } /* 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 --git a/libpurple/protocols/jabber/useravatar.c b/libpurple/protocols/jabber/useravatar.c index 7851067dff..f902944173 100644 --- a/libpurple/protocols/jabber/useravatar.c +++ b/libpurple/protocols/jabber/useravatar.c @@ -229,7 +229,7 @@ do_got_own_avatar_cb(JabberStream *js, const char *from, xmlnode *items) * 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 @@ do_got_own_avatar_cb(JabberStream *js, const char *from, xmlnode *items) 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); } |