changeset 16538:abe54db1c93a

merge of '051db257b4f90ae0b989a3bd72aa69f0a6a55693' and '0ba23e62c3621686b75699a889df95061175914a'
author Sadrul Habib Chowdhury <imadil@gmail.com>
date Fri, 27 Apr 2007 22:50:16 +0000
parents ba7c7b98e294 (current diff) 0b49b01e9482 (diff)
children 8748c83af14f 478bc85c4aec
files PROGRAMMING_NOTES
diffstat 2 files changed, 9 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo.c	Fri Apr 27 21:54:57 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo.c	Fri Apr 27 22:50:16 2007 +0000
@@ -345,6 +345,7 @@
 			/* FIXME: Please, if you know this protocol,
 			 * FIXME: fix up the strtol() stuff if possible. */
 			int cksum = strtol(pair->value, NULL, 10);
+			const char *locksum = NULL;
 			PurpleBuddy *b;
 
 			if (!name)
@@ -363,7 +364,8 @@
 				break;
 
 			yahoo_friend_set_buddy_icon_need_request(f, FALSE);
-			if (b && cksum != strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10))
+			if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL &&
+					cksum != strtol(locksum, NULL, 10))
 				yahoo_send_picture_request(gc, name);
 
 			break;
--- a/libpurple/protocols/yahoo/yahoo_picture.c	Fri Apr 27 21:54:57 2007 +0000
+++ b/libpurple/protocols/yahoo/yahoo_picture.c	Fri Apr 27 22:50:16 2007 +0000
@@ -115,9 +115,11 @@
 		PurpleUtilFetchUrlData *url_data;
 		struct yahoo_fetch_picture_data *data;
 		PurpleBuddy *b = purple_find_buddy(gc->account, who);
+		const char *locksum = NULL;
 
 		/* FIXME: Cleanup this strtol() stuff if possible. */
-		if (b && (checksum == strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10)))
+		if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && 
+				(checksum == strtol(locksum, NULL, 10)))
 			return;
 
 		data = g_new0(struct yahoo_fetch_picture_data, 1);
@@ -200,9 +202,11 @@
 
 	if (who) {
 		PurpleBuddy *b = purple_find_buddy(gc->account, who);
+		const char *locksum = NULL;
 
 		/* FIXME: Cleanup this strtol() stuff if possible. */
-		if (b && (checksum != strtol(purple_buddy_icons_get_checksum_for_user(b), NULL, 10)))
+		if (b && (locksum = purple_buddy_icons_get_checksum_for_user(b)) != NULL && 
+				(checksum != strtol(locksum, NULL, 10)))
 			yahoo_send_picture_request(gc, who);
 	}
 }