pidgin: dbaf898e: jabber: Go back to not overwriting avata...
darkrain42 at pidgin.im
darkrain42 at pidgin.im
Fri Nov 13 14:06:19 EST 2009
-----------------------------------------------------------------
Revision: dbaf898ed87f7d5508c202ad58882dfb4abb9072
Ancestor: 8f610d7330f0aaff7e30a163335e1f42048dae77
Author: darkrain42 at pidgin.im
Date: 2009-11-13T18:39:23
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/dbaf898ed87f7d5508c202ad58882dfb4abb9072
Modified files:
libpurple/protocols/jabber/buddy.c
libpurple/protocols/jabber/useravatar.c
ChangeLog:
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.
-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c 9a47cd9c950377ee7b1ccc6395d9343e88d48a3a
+++ libpurple/protocols/jabber/buddy.c 567babef3366c51d91131d5d5b2876b14c0b7053
@@ -924,7 +924,7 @@ static void jabber_vcard_save_mine(Jabbe
}
/* 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;
============================================================
--- libpurple/protocols/jabber/useravatar.c a6fbf9ca37be81d191d3ae8f54d7f4a4c62c689e
+++ libpurple/protocols/jabber/useravatar.c b7e1ef755ba6ce4fa301fcae5b78b62f7e7f7c23
@@ -229,7 +229,7 @@ do_got_own_avatar_cb(JabberStream *js, c
* 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(JabberStre
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);
}
More information about the Commits
mailing list