diff libpurple/account.c @ 16482:3be560001d26

Kill some compiler warnings and TODOs of mine.
author Richard Laager <rlaager@wiktel.com>
date Wed, 25 Apr 2007 23:29:46 +0000
parents 4fc51a87ce42
children 5e47b3427b28
line wrap: on
line diff
--- a/libpurple/account.c	Wed Apr 25 22:24:15 2007 +0000
+++ b/libpurple/account.c	Wed Apr 25 23:29:46 2007 +0000
@@ -740,7 +740,17 @@
 	child = xmlnode_get_child(node, "buddyicon");
 	if ((child != NULL) && ((data = xmlnode_get_data(child)) != NULL))
 	{
-		// TODO: Read the file and cache it using the new system
+		const char *dirname = purple_buddy_icons_get_cache_dir();
+		char *filename = g_build_filename(dirname, data, NULL);
+		gchar *contents;
+		gsize len;
+
+		if (g_file_get_contents(filename, &contents, &len, NULL))
+		{
+			purple_buddy_icons_set_account_icon(ret, (guchar *)contents, len);
+		}
+
+		g_free(filename);
 		g_free(data);
 	}