changeset 9325:f40233043b5a

[gaim-migrate @ 10133] This fixes some oddities with fetching a users icon if he had previously unset it, and then set the same one. We were forgetting to unset some flags and also the checksum, so we noticed the checksum was the same and didn't ask for the icon, even though we didn't have an icon. Its still not always fetching it, which is odd. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Sun, 20 Jun 2004 07:38:40 +0000
parents af707cc1e229
children 5ca18080b6bd
files src/protocols/yahoo/yahoo.c src/protocols/yahoo/yahoo_picture.c
diffstat 2 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/yahoo/yahoo.c	Sun Jun 20 06:57:54 2004 +0000
+++ b/src/protocols/yahoo/yahoo.c	Sun Jun 20 07:38:40 2004 +0000
@@ -443,14 +443,20 @@
 			if (!name)
 				break;
 
+			b = gaim_find_buddy(gc->account, name);
+
 			if (!cksum || (cksum == -1)) {
+				if (f)
+					yahoo_friend_set_buddy_icon_need_request(f, TRUE);
 				gaim_buddy_icons_set_for_user(gc->account, name, NULL, 0);
+				if (b)
+					gaim_blist_node_remove_setting((GaimBlistNode *)b, YAHOO_ICON_CHECKSUM_KEY);
 				break;
 			}
 
 			if (!f)
 				break;
-			b = gaim_find_buddy(gc->account, name);
+
 			yahoo_friend_set_buddy_icon_need_request(f, FALSE);
 			if (cksum != gaim_blist_node_get_int((GaimBlistNode*)b, YAHOO_ICON_CHECKSUM_KEY))
 				yahoo_send_picture_request(gc, name);
--- a/src/protocols/yahoo/yahoo_picture.c	Sun Jun 20 06:57:54 2004 +0000
+++ b/src/protocols/yahoo/yahoo_picture.c	Sun Jun 20 07:38:40 2004 +0000
@@ -148,7 +148,13 @@
 		if (icon == 2)
 			yahoo_send_picture_request(gc, who);
 		else if ((icon == 0) || (icon == 1)) {
+			GaimBuddy *b = gaim_find_buddy(gc->account, who);
+			YahooFriend *f;
 			gaim_buddy_icons_set_for_user(gc->account, who, NULL, 0);
+			if (b)
+				gaim_blist_node_remove_setting((GaimBlistNode *)b, YAHOO_ICON_CHECKSUM_KEY);
+			if ((f = yahoo_friend_find(gc, who)))
+				yahoo_friend_set_buddy_icon_need_request(f, TRUE);
 			gaim_debug_misc("yahoo", "Setting user %s's icon to NULL.\n", who);
 		}
 	}