comparison src/gtkconv.c @ 8374:e7463be62fb1

[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 <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Mon, 01 Mar 2004 02:51:13 +0000
parents 80915fd16349
children 4a5b36510665
comparison
equal deleted inserted replaced
8373:7a58f6f9fc3e 8374:e7463be62fb1
4997 else 4997 else
4998 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons"); 4998 gtkconv->u.im->animate = gaim_prefs_get_bool("/gaim/gtk/conversations/im/animate_buddy_icons");
4999 4999
5000 if((buddy = gaim_find_buddy(gaim_conversation_get_account(conv), 5000 if((buddy = gaim_find_buddy(gaim_conversation_get_account(conv),
5001 gaim_conversation_get_name(conv))) != NULL) { 5001 gaim_conversation_get_name(conv))) != NULL) {
5002 const char *file; 5002 const char *iconfile;
5003 if((file = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"))) 5003 if((iconfile = gaim_blist_node_get_string((GaimBlistNode*)buddy, "buddy_icon"))) {
5004 gtkconv->u.im->anim = gdk_pixbuf_animation_new_from_file(file, &err); 5004 GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(conv));
5005 struct stat st;
5006 if ((icon == NULL) && (!stat(iconfile, &st))) {
5007 FILE *file = fopen(iconfile, "rb");
5008 if (file) {
5009 char *data = g_malloc(st.st_size);
5010 fread(data, 1, st.st_size, file);
5011 fclose(file);
5012 gaim_buddy_icons_set_for_user(gaim_conversation_get_account(conv), gaim_conversation_get_name(conv), data, st.st_size);
5013 g_free(data);
5014 }
5015 return;
5016 }
5017 else
5018 gtkconv->u.im->anim = gdk_pixbuf_animation_new_from_file(iconfile, &err);
5019 }
5005 } 5020 }
5006 else 5021 else
5007 { 5022 {
5008 GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(conv)); 5023 GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(conv));
5009 5024