# HG changeset patch # User Mark Doliner # Date 1078109473 0 # Node ID e7463be62fb109698fa470b3d3f8dac8a33432f9 # Parent 7a58f6f9fc3e12aa9753db6ddaa3a7506f6fb6b4 [gaim-migrate @ 9101] A patch from nosnilmot to make right-clicking and saving on a buddy icon in a conversation window work if the icon was received before the conv window was open. Looks good to me. Icon code is confoosing. committer: Tailor Script diff -r 7a58f6f9fc3e -r e7463be62fb1 src/gtkconv.c --- a/src/gtkconv.c Mon Mar 01 01:00:08 2004 +0000 +++ b/src/gtkconv.c Mon Mar 01 02:51:13 2004 +0000 @@ -4999,9 +4999,24 @@ if((buddy = gaim_find_buddy(gaim_conversation_get_account(conv), gaim_conversation_get_name(conv))) != NULL) { - const char *file; - if((file = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"))) - gtkconv->u.im->anim = gdk_pixbuf_animation_new_from_file(file, &err); + const char *iconfile; + if((iconfile = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"))) { + GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(conv)); + struct stat st; + if ((icon == NULL) && (!stat(iconfile, &st))) { + FILE *file = fopen(iconfile, "rb"); + if (file) { + char *data = g_malloc(st.st_size); + fread(data, 1, st.st_size, file); + fclose(file); + gaim_buddy_icons_set_for_user(gaim_conversation_get_account(conv), gaim_conversation_get_name(conv), data, st.st_size); + g_free(data); + } + return; + } + else + gtkconv->u.im->anim = gdk_pixbuf_animation_new_from_file(iconfile, &err); + } } else {