# HG changeset patch # User Paul Aurich # Date 1249094653 0 # Node ID 93d9cf1151a48b97547236be6a024bcec836199c # Parent cbbde19ce02d791e1719f5d4a1d101c8e2bf8771 jabber: Fix setting the PEP node the first time. The first time a PEP node is set, it's going to be auto-created, which means the IQ fetch is going to return an error, so don't ignore the error condition. diff -r cbbde19ce02d -r 93d9cf1151a4 libpurple/protocols/jabber/useravatar.c --- 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);