diff src/gtkblist.c @ 9396:84594a281500

[gaim-migrate @ 10208] This fixes a bug that shx pointed out, that I accidently introduced, whereby, if a buddy has an icon, that hasn't been updated since you started gaim, but was cached at some earlier point in time, and you are using the small list, when you opened a conversation with them, you would not see their buddy icon. The work-around for 0.79 is to use the big list, or have friends who change their buddy icons a lot. committer: Tailor Script <tailor@pidgin.im>
author Tim Ringenbach <marv@pidgin.im>
date Fri, 25 Jun 2004 05:30:10 +0000
parents 7fa8eff579b5
children eae7e049d639
line wrap: on
line diff
--- a/src/gtkblist.c	Fri Jun 25 03:50:53 2004 +0000
+++ b/src/gtkblist.c	Fri Jun 25 05:30:10 2004 +0000
@@ -2623,36 +2623,19 @@
 
 static GdkPixbuf *gaim_gtk_blist_get_buddy_icon(GaimBuddy *b)
 {
-	const char *file;
 	GdkPixbuf *buf, *ret;
 	GdkPixbufLoader *loader;
 	GaimBuddyIcon *icon;
 	const char *data;
 	size_t len;
-	struct stat st;
 
 	if (!gaim_prefs_get_bool("/gaim/gtk/blist/show_buddy_icons"))
 		return NULL;
 
-	if (!(icon = gaim_buddy_get_icon(b))) {
-		if ((file = gaim_blist_node_get_string((GaimBlistNode*)b, "buddy_icon")) == NULL)
+	if (!(icon = gaim_buddy_get_icon(b)))
+		if (!(icon = gaim_buddy_icons_find(b->account, b->name))) /* Not sure I like this...*/
 			return NULL;
 
-		/* This is a hack, we should be loading up the GaimBuddyIcon's somewhere
-		 * else, like the core, like when we parse the blist.xml file. */
-		if (!stat(file, &st)) {
-			FILE *f = fopen(file, "rb");
-			if (f) {
-				char *data = g_malloc(st.st_size);
-				fread(data, 1, st.st_size, f);
-				fclose(f);
-				gaim_buddy_icons_set_for_user(b->account, b->name, data, st.st_size);
-				g_free(data);
-			}
-		}
-
-		return NULL; /* Either no icon, or we just set one and so this will get called again */
-	}
 
 	loader = gdk_pixbuf_loader_new();
 	data = gaim_buddy_icon_get_data(icon, &len);