pidgin: f65f1d9e: Paul noticed that the conditional blocks...

deryni at pidgin.im deryni at pidgin.im
Wed Jan 7 09:06:10 EST 2009


-----------------------------------------------------------------
Revision: f65f1d9e6c755034926183d758e41e4374fd1291
Ancestor: 894e51e3fe73971f510344112de71a2b027d4499
Author: paul at darkrain42.org
Date: 2009-01-07T04:12:11
Branch: im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/f65f1d9e6c755034926183d758e41e4374fd1291

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

ChangeLog: 

Paul noticed that the conditional blocks here were backwards. I'm surprised no
one seems to have noticed this before now.

References #7974

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/buddy.c	2867b3f51329b7b20a8ee44d97879fb5242b9031
+++ libpurple/protocols/jabber/buddy.c	d9ea06be03f2a3c1d69f8168e4ce43b8a8065a65
@@ -578,32 +578,30 @@ void jabber_set_buddy_icon(PurpleConnect
 				jabber_pep_publish((JabberStream*)gc->proto_data, publish);
 				
 				g_free(hash);
-			} else { /* if(img) */
-				/* remove the metadata */
-				xmlnode *metadata, *item;
-				xmlnode *publish = xmlnode_new("publish");
-				xmlnode_set_attrib(publish,"node",AVATARNAMESPACEMETA);
-				
-				item = xmlnode_new_child(publish, "item");
-				
-				metadata = xmlnode_new_child(item, "metadata");
-				xmlnode_set_namespace(metadata,AVATARNAMESPACEMETA);
-				
-				xmlnode_new_child(metadata, "stop");
-				
-				/* publish the metadata */
-				jabber_pep_publish((JabberStream*)gc->proto_data, publish);
+			} else {
+				purple_debug_error("jabber", "jabber_set_buddy_icon received non-png data");
 			}
 		} else {
-			purple_debug(PURPLE_DEBUG_ERROR, "jabber",
-						 "jabber_set_buddy_icon received non-png data");
+			/* remove the metadata */
+			xmlnode *metadata, *item;
+			xmlnode *publish = xmlnode_new("publish");
+			xmlnode_set_attrib(publish,"node",AVATARNAMESPACEMETA);
+
+			item = xmlnode_new_child(publish, "item");
+
+			metadata = xmlnode_new_child(item, "metadata");
+			xmlnode_set_namespace(metadata,AVATARNAMESPACEMETA);
+
+			xmlnode_new_child(metadata, "stop");
+
+			/* publish the metadata */
+			jabber_pep_publish((JabberStream*)gc->proto_data, publish);
 		}
 	}
 
-	/* even when the image is not png, we can still publish the vCard, since this
-	   one doesn't require a specific image type */
-
-	/* publish vCard for those poor older clients */
+	/* vCard avatars do not have an image type requirement so update our
+	 * vCard avatar regardless of image type for those poor older clients
+	 */
 	jabber_set_info(gc, purple_account_get_user_info(gc->account));
 
 	gpresence = purple_account_get_presence(gc->account);


More information about the Commits mailing list