# HG changeset patch # User Richard Laager # Date 1177648121 0 # Node ID 1d1ddf972ac81c98debadf8a8b0365a2131ad0cf # Parent 3ef6a81a9fbac6d2fe0776acb73c6c8546fc49a5 Ref the filenames for account buddy icons on load. diff -r 3ef6a81a9fba -r 1d1ddf972ac8 libpurple/account.c --- a/libpurple/account.c Fri Apr 27 04:18:02 2007 +0000 +++ b/libpurple/account.c Fri Apr 27 04:28:41 2007 +0000 @@ -792,6 +792,8 @@ } xmlnode_free(node); + + purple_buddy_icons_account_loaded_cb(); } diff -r 3ef6a81a9fba -r 1d1ddf972ac8 libpurple/buddyicon.c --- a/libpurple/buddyicon.c Fri Apr 27 04:18:02 2007 +0000 +++ b/libpurple/buddyicon.c Fri Apr 27 04:28:41 2007 +0000 @@ -960,6 +960,30 @@ } void +purple_buddy_icons_account_loaded_cb() +{ + GList *cur; + + for (cur = purple_accounts_get_all(); cur != NULL; cur = cur->next) + { + PurpleAccount *account = cur->data; + const char *account_icon_file = purple_account_get_string(account, "buddy_icon", NULL); + + if (account_icon_file != NULL) + { + char *path = g_build_filename(dirname, filename, NULL); + if (!g_file_test(filename, G_FILE_TEST_EXISTS)) + { + purple_account_set_string(account, "buddy_icon", NULL); + } else { + ref_filename(account_icon_file); + } + g_free(path); + } + } +} + +void purple_buddy_icons_blist_loaded_cb() { PurpleBlistNode *node = purple_blist_get_root(); diff -r 3ef6a81a9fba -r 1d1ddf972ac8 libpurple/internal.h --- a/libpurple/internal.h Fri Apr 27 04:18:02 2007 +0000 +++ b/libpurple/internal.h Fri Apr 27 04:28:41 2007 +0000 @@ -184,6 +184,11 @@ #define PURPLE_WEBSITE "http://pidgin.im/" +/* This is for the accounts code to notify the buddy icon code that + * it's done loading. We may want to replace this with a signal. */ +void +purple_buddy_icons_account_loaded_cb(void); + /* This is for the buddy list to notify the buddy icon code that * it's done loading. We may want to replace this with a signal. */ void