# HG changeset patch # User Paul Aurich # Date 1231303168 0 # Node ID 1e121a3eceebec4a3e30b0d7f71966f830b5fd52 # Parent c07b0aa88a35418a5fd15e87a507a679840c4cc5 Allow us to remove vCard avatars when the PurpleAccount doesn't have one specified. Closes #7974 committer: Etan Reisner diff -r c07b0aa88a35 -r 1e121a3eceeb ChangeLog --- a/ChangeLog Wed Jan 07 04:12:11 2009 +0000 +++ b/ChangeLog Wed Jan 07 04:39:28 2009 +0000 @@ -15,6 +15,8 @@ XMPP: * Support for XEP-0191 blocking. (Vijay Raghunathan) * Don't put SASL PLAIN or IQ Auth passwords in debug logs. (Paul Aurich) + * Fix removal of avatars (both PEP and vCard), we weren't removing + them correctly before. (Paul Aurich) Pidgin: * Fix a crash in the Add Account dialog when changing protocols under diff -r c07b0aa88a35 -r 1e121a3eceeb libpurple/protocols/jabber/buddy.c --- a/libpurple/protocols/jabber/buddy.c Wed Jan 07 04:12:11 2009 +0000 +++ b/libpurple/protocols/jabber/buddy.c Wed Jan 07 04:39:28 2009 +0000 @@ -459,7 +459,10 @@ avatar_data = purple_imgstore_get_data(img); avatar_len = purple_imgstore_get_size(img); - /* have to get rid of the old PHOTO if it exists */ + /* Get rid of an old PHOTO if one exists. + * TODO: This may want to be modified to remove all old PHOTO + * children, at the moment some people have managed to get + * multiple PHOTO entries in their vCard. */ if((photo = xmlnode_get_child(vc_node, "PHOTO"))) { xmlnode_free(photo); } @@ -473,6 +476,12 @@ xmlnode_insert_data(binval, enc, -1); g_free(enc); + } else if (vc_node) { + xmlnode *photo; + /* TODO: Remove all PHOTO children? (see above note) */ + if ((photo = xmlnode_get_child(vc_node, "PHOTO"))) { + xmlnode_free(photo); + } } if (vc_node != NULL) {