comparison libpurple/protocols/jabber/useravatar.c @ 28914:e14402d6c5e0

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.
author Paul Aurich <paul@darkrain42.org>
date Fri, 13 Nov 2009 18:39:23 +0000
parents fa7f3426ed13
children 93e8e6331d44
comparison
equal deleted inserted replaced
28913:43d5face5d9b 28914:e14402d6c5e0
227 /* 227 /*
228 * If we have an avatar and the server returned an error/malformed data, 228 * If we have an avatar and the server returned an error/malformed data,
229 * push our avatar. If the server avatar doesn't match the local one, push 229 * push our avatar. If the server avatar doesn't match the local one, push
230 * our avatar. 230 * our avatar.
231 */ 231 */
232 if (((!items || !metadata) && js->initial_avatar_hash) || 232 if ((!items || !metadata) ||
233 !purple_strequal(server_hash, js->initial_avatar_hash)) { 233 !purple_strequal(server_hash, js->initial_avatar_hash)) {
234 PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account); 234 PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account);
235 jabber_avatar_set(js, img); 235 jabber_avatar_set(js, img);
236 purple_imgstore_unref(img); 236 purple_imgstore_unref(img);
237 } 237 }
238 } 238 }
239 239
240 void jabber_avatar_fetch_mine(JabberStream *js) 240 void jabber_avatar_fetch_mine(JabberStream *js)
241 { 241 {
242 char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain); 242 char *jid = g_strdup_printf("%s@%s", js->user->node, js->user->domain);
243 jabber_pep_request_item(js, jid, NS_AVATAR_0_12_METADATA, NULL, 243
244 do_got_own_avatar_0_12_cb); 244 if (js->initial_avatar_hash) {
245 jabber_pep_request_item(js, jid, NS_AVATAR_1_1_METADATA, NULL, 245 jabber_pep_request_item(js, jid, NS_AVATAR_0_12_METADATA, NULL,
246 do_got_own_avatar_cb); 246 do_got_own_avatar_0_12_cb);
247 jabber_pep_request_item(js, jid, NS_AVATAR_1_1_METADATA, NULL,
248 do_got_own_avatar_cb);
249 }
250
247 g_free(jid); 251 g_free(jid);
248 } 252 }
249 253
250 typedef struct _JabberBuddyAvatarUpdateURLInfo { 254 typedef struct _JabberBuddyAvatarUpdateURLInfo {
251 JabberStream *js; 255 JabberStream *js;