--- a/libpurple/protocols/jabber/useravatar.c Sat Aug 01 02:33:41 2009 +0000 +++ b/libpurple/protocols/jabber/useravatar.c Sat Aug 01 02:44:13 2009 +0000 @@ -219,16 +219,18 @@ const char *server_hash = NULL; if (items && (item = xmlnode_get_child(items, "item")) && - (metadata = xmlnode_get_child(item, "metadata")) && - (info = xmlnode_get_child(metadata, "info"))) { + (metadata = xmlnode_get_child(item, "metadata")) && + (info = xmlnode_get_child(metadata, "info"))) { server_hash = xmlnode_get_attrib(info, "id"); } - if (items && !metadata) - return; - - /* Publish ours if it's different than the server's */ - if (!purple_strequal(server_hash, js->initial_avatar_hash)) { + /* + * If we have an avatar and the server returned an error/malformed data, + * push our avatar. If the server avatar doesn't match the local one, push + * our avatar. + */ + if (((!items || !metadata) && js->initial_avatar_hash) || + !purple_strequal(server_hash, js->initial_avatar_hash)) { PurpleStoredImage *img = purple_buddy_icons_find_account_icon(account); jabber_avatar_set(js, img); purple_imgstore_unref(img);