pidgin: 91c54e1c: Allow us to remove vCard avatars when th...

deryni at pidgin.im deryni at pidgin.im
Wed Jan 7 09:05:55 EST 2009


-----------------------------------------------------------------
Revision: 91c54e1cd7a33198f97836ac32ab8f3f3111efe6
Ancestor: f65f1d9e6c755034926183d758e41e4374fd1291
Author: paul at darkrain42.org
Date: 2009-01-07T04:39:28
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/91c54e1cd7a33198f97836ac32ab8f3f3111efe6

Modified files:
        ChangeLog libpurple/protocols/jabber/buddy.c

ChangeLog: 

Allow us to remove vCard avatars when the PurpleAccount doesn't have one
specified.

Closes #7974

-------------- next part --------------
============================================================
--- ChangeLog	71a2285cf9fb4f1fd1b0d1c00d315aca64db1165
+++ ChangeLog	e34fdfea68d81f89d2fec5381a77b38e537e35ac
@@ -15,6 +15,8 @@ version 2.5.4 (??/??/????):
 	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
============================================================
--- libpurple/protocols/jabber/buddy.c	d9ea06be03f2a3c1d69f8168e4ce43b8a8065a65
+++ libpurple/protocols/jabber/buddy.c	12c562ff1d43048fe38b9853e3e4c5979039ff39
@@ -459,7 +459,10 @@ void jabber_set_info(PurpleConnection *g
 
 		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 @@ void jabber_set_info(PurpleConnection *g
 
 		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) {


More information about the Commits mailing list