comparison src/dialogs.c @ 6846:8ab95f4c9800

[gaim-migrate @ 7391] Added new buddy icon caching code. Each GaimBuddy has its own icon, and the complete list of all icons is now stored in a set of hashtables for quick retrieval. Buddy icons now live much happier in the core, with the magma and tooth fairies (that's where they really live). committer: Tailor Script <tailor@pidgin.im>
author Christian Hammond <chipx86@chipx86.com>
date Mon, 15 Sep 2003 07:35:49 +0000
parents faa491042c66
children bb70dc397782
comparison
equal deleted inserted replaced
6845:5de4d9a4e0e2 6846:8ab95f4c9800
830 { 830 {
831 const char *grp, *who, *whoalias; 831 const char *grp, *who, *whoalias;
832 GaimConversation *c; 832 GaimConversation *c;
833 GaimBuddy *b; 833 GaimBuddy *b;
834 GaimGroup *g; 834 GaimGroup *g;
835 void *icon_data;
836 void *icon_data2;
837 int icon_len;
838 835
839 if (resp == GTK_RESPONSE_OK) { 836 if (resp == GTK_RESPONSE_OK) {
840 837
841 who = gtk_entry_get_text(GTK_ENTRY(a->entry)); 838 who = gtk_entry_get_text(GTK_ENTRY(a->entry));
842 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry)); 839 grp = gtk_entry_get_text(GTK_ENTRY(GTK_COMBO(a->combo)->entry));
850 b = gaim_buddy_new(a->gc->account, who, whoalias); 847 b = gaim_buddy_new(a->gc->account, who, whoalias);
851 gaim_blist_add_buddy(b, NULL, g, NULL); 848 gaim_blist_add_buddy(b, NULL, g, NULL);
852 serv_add_buddy(a->gc, who, g); 849 serv_add_buddy(a->gc, who, g);
853 850
854 if (c != NULL) 851 if (c != NULL)
855 gaim_conversation_update(c, GAIM_CONV_UPDATE_ADD); 852 gaim_buddy_icon_update(gaim_im_get_icon(GAIM_IM(c)));
856
857 icon_data = get_icon_data(a->gc, normalize(who), &icon_len);
858
859 if(icon_data) {
860 icon_data2 = g_memdup(icon_data, icon_len);
861 set_icon_data(a->gc, who, icon_data2, icon_len);
862 g_free(icon_data2);
863 }
864 853
865 gaim_blist_save(); 854 gaim_blist_save();
866 } 855 }
867 856
868 destroy_dialog(NULL, a->window); 857 destroy_dialog(NULL, a->window);