changeset 9801:7aa5a20519ee

[gaim-migrate @ 10669] On Fri, 2004-08-20 at 23:57, Tim Ringenbach wrote: > > relative buddy icon paths instead of absolute ones from nosnilmot. this > > should save some headaches migrating a ~/.gaim around > I think you broke something here. On start up I notice all buddy icons > are fetched again, and they only show up in my buddy list, never my > conversation window. I did break something. I think the logic of "if the old file doesn't exist, then delete the new one instead" when removing old icons isn't exactly what I meant to do. You were also correct to point out that prpls might use them directly - oscar does. Patch attached to fix both cases. Regards, Stu. committer: Tailor Script <tailor@pidgin.im>
author Luke Schierer <lschiere@pidgin.im>
date Sat, 21 Aug 2004 15:05:45 +0000
parents cc68a8c6e741
children acf175d9f79b
files src/buddyicon.c src/protocols/oscar/oscar.c
diffstat 2 files changed, 10 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/buddyicon.c	Sat Aug 21 05:12:23 2004 +0000
+++ b/src/buddyicon.c	Sat Aug 21 15:05:45 2004 +0000
@@ -246,7 +246,7 @@
 		if(!stat(old_icon, &st))
 			unlink(old_icon);
 		else {
-			filename = g_build_filename(dirname, random, NULL);
+			filename = g_build_filename(dirname, old_icon, NULL);
 			if(!stat(filename, &st))
 				unlink(filename);
 			g_free(filename);
--- a/src/protocols/oscar/oscar.c	Sat Aug 21 05:12:23 2004 +0000
+++ b/src/protocols/oscar/oscar.c	Sat Aug 21 15:05:45 2004 +0000
@@ -2763,7 +2763,7 @@
 	/* Server stored icon stuff */
 	if (info->iconcsumlen) {
 		const char *filename = NULL, *saved_b16 = NULL;
-		char *b16 = NULL;
+		char *b16 = NULL, *filepath = NULL;
 		GaimBuddy *b = NULL;
 
 		b16 = gaim_base16_encode(info->iconcsum, info->iconcsumlen);
@@ -2777,6 +2777,14 @@
 			if (g_file_test(filename, G_FILE_TEST_EXISTS))
 				saved_b16 = gaim_blist_node_get_string((GaimBlistNode*)b,
 						"icon_checksum");
+			else {
+				filepath = g_build_filename(gaim_buddy_icons_get_cache_dir(),
+											filename, NULL);
+				if (g_file_test(filepath, G_FILE_TEST_EXISTS))
+					saved_b16 = gaim_blist_node_get_string((GaimBlistNode*)b,
+															"icon_checksum");
+				g_free(filepath);
+			}
 		} else
 			saved_b16 = NULL;