changeset 17054:6ec8bae7d98a

Patch #1038. Fix receiving of Yahoo buddy icons. Thanks, vampire!
author Sean Egan <seanegan@gmail.com>
date Wed, 23 May 2007 23:13:11 +0000
parents 461297da2e28
children cb5bd3c045a9
files libpurple/protocols/yahoo/yahoo.c libpurple/protocols/yahoo/yahoo_picture.c
diffstat 2 files changed, 13 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Wed May 23 22:34:19 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Wed May 23 23:13:11 2007 +0000
@@ -365,9 +365,11 @@
 				break;
 
 			yahoo_friend_set_buddy_icon_need_request(f, FALSE);
-			if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL &&
-					cksum != strtol(locksum, NULL, 10))
-				yahoo_send_picture_request(gc, name);
+			if (b) {
+				locksum = purple_buddy_icons_get_checksum_for_user(b);
+				if (!locksum || (cksum != strtol(locksum, NULL, 10)))
+					yahoo_send_picture_request(gc, name);
+			}
 
 			break;
 		}
--- a/libpurple/protocols/yahoo/yahoo_picture.c	Wed May 23 22:34:19 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_picture.c	Wed May 23 23:13:11 2007 +0000
@@ -157,7 +157,10 @@
 		case 5:
 			/* us */
 			break;
+		/* NOTE: currently the server seems to only send 213; 206 was used
+		 * in older versions. Check whether it's still needed. */
 		case 206:
+		case 213:
 			icon = strtol(pair->value, NULL, 10);
 			break;
 		}
@@ -205,9 +208,11 @@
 		const char *locksum = NULL;
 
 		/* FIXME: Cleanup this strtol() stuff if possible. */
-		if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && 
-				(checksum != strtol(locksum, NULL, 10)))
-			yahoo_send_picture_request(gc, who);
+		if (b) {
+			locksum = purple_buddy_icons_get_checksum_for_user(b);
+			if (!locksum || (checksum != strtol(locksum, NULL, 10)))
+				yahoo_send_picture_request(gc, who);
+		}
 	}
 }