# HG changeset patch # User Sadrul Habib Chowdhury # Date 1177783711 0 # Node ID 66f0cda796e10c996206f9533f23aed40369f27d # Parent bc03699814a1fe542938a81279596513b2f414a8 Part of the patch in ticket #383 To make sure that account-icons are kept after migration, I look into the old icons location, and if possible, the icon is set to the account, which causes the icon to be stored in the new cache location. committer: Richard Laager diff -r bc03699814a1 -r 66f0cda796e1 libpurple/account.c --- a/libpurple/account.c Sat Apr 28 18:02:26 2007 +0000 +++ b/libpurple/account.c Sat Apr 28 18:08:31 2007 +0000 @@ -749,6 +749,15 @@ { purple_buddy_icons_set_account_icon(ret, (guchar *)contents, len); } + else + { + /* Try to see if the icon got left behind in the old cache. */ + g_free(filename); + filename = g_build_filename(g_get_home_dir(), ".gaim", "icons", data, NULL); + 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);