# HG changeset patch # User Mark Doliner # Date 1078008334 0 # Node ID 19459d9eead2e17513e13aaf4e509f0ff5d292cd # Parent 1976914caa51c3967fe82730673a71f08223d75c [gaim-migrate @ 9088] Nice patch from nosnilmot to make AIM icons work better. My testing made me realize 2 things still don't work well: Gaim doesn't clear icons when someone else sets their icon to nothing Gaim doesn't show some icons. Maybe the official ones? With the shorter, constant checksum thing? committer: Tailor Script diff -r 1976914caa51 -r 19459d9eead2 ChangeLog --- a/ChangeLog Sat Feb 28 21:14:51 2004 +0000 +++ b/ChangeLog Sat Feb 28 22:45:34 2004 +0000 @@ -33,6 +33,9 @@ * Tabs now stay green when they are supposed to (Etan Reisner) * Fixed a bug where only the first user in a chat room list was removed sometimes when trying to remove a group of users (Tim Ringenbach) + * Clearing an AIM buddy icon actually removes it from the server, + icons changes in the account editor do not take effect if the + canel button is used (Stu Tomlinson) * Improved chat parting logic (Tim Ringenbach) * Yet Another IRC channel user duplication bugfix (Tim Ringenbach) * TCL Plugin API changed diff -r 1976914caa51 -r 19459d9eead2 src/gtkaccount.c --- a/src/gtkaccount.c Sat Feb 28 21:14:51 2004 +0000 +++ b/src/gtkaccount.c Sat Feb 28 22:45:34 2004 +0000 @@ -252,9 +252,6 @@ return; } - if (dialog->account != NULL) - gaim_account_set_buddy_icon(dialog->account, filename); - gtk_entry_set_text(GTK_ENTRY(dialog->buddy_icon_entry), filename); gtk_widget_destroy(dialog->buddy_icon_filesel); } @@ -349,8 +346,6 @@ buddy_icon_reset_cb(GtkWidget *button, AccountPrefsDialog *dialog) { gtk_entry_set_text(GTK_ENTRY(dialog->buddy_icon_entry), ""); - if (dialog->account) - gaim_account_set_buddy_icon(dialog->account, NULL); } static void diff -r 1976914caa51 -r 19459d9eead2 src/gtkimhtml.c --- a/src/gtkimhtml.c Sat Feb 28 21:14:51 2004 +0000 +++ b/src/gtkimhtml.c Sat Feb 28 22:45:34 2004 +0000 @@ -1377,7 +1377,6 @@ g_return_val_if_fail (imhtml != NULL, NULL); g_return_val_if_fail (GTK_IS_IMHTML (imhtml), NULL); g_return_val_if_fail (text != NULL, NULL); - printf("Appending: %s\n", text); c = text; len = strlen(text); ws = g_malloc(len + 1); @@ -1913,7 +1912,6 @@ if (url) gtk_imhtml_insert_link(imhtml, url, ws); else { - printf("Inserting %s\n", ws); gtk_text_buffer_insert(imhtml->text_buffer, &iter, ws, wpos); } wpos = g_snprintf (ws, smilelen + 1, "%s", c); @@ -2885,7 +2883,6 @@ closers = g_list_remove(closers, span); } - printf("Gotten: %s\n", str->str); return g_string_free(str, FALSE); } diff -r 1976914caa51 -r 19459d9eead2 src/gtkutils.c --- a/src/gtkutils.c Sat Feb 28 21:14:51 2004 +0000 +++ b/src/gtkutils.c Sat Feb 28 22:45:34 2004 +0000 @@ -282,14 +282,12 @@ if (gaim_gtk_check_if_dir(f, GTK_FILE_SELECTION(gtkconv->u.im->save_icon))) return; - if ((file = fopen(f, "w")) != NULL) { - GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(c)); - size_t len; - const void *data = gaim_buddy_icon_get_data(icon, &len); + GaimBuddyIcon *icon = gaim_conv_im_get_icon(GAIM_CONV_IM(c)); + size_t len; + const void *data = gaim_buddy_icon_get_data(icon, &len); - if (data) - fwrite(data, 1, len, file); - + if ((len > 0) && (data != NULL) && (file = fopen(f, "wb")) != NULL) { + fwrite(data, 1, len, file); fclose(file); } else { gaim_notify_error(NULL, NULL, diff -r 1976914caa51 -r 19459d9eead2 src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Sat Feb 28 21:14:51 2004 +0000 +++ b/src/protocols/oscar/oscar.c Sat Feb 28 22:45:34 2004 +0000 @@ -3616,7 +3616,7 @@ struct stat st; const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc)); if (iconfile == NULL) { - /* Set an empty icon, or something */ + aim_ssi_delicon(od->sess); } else if (!stat(iconfile, &st)) { char *buf = g_malloc(st.st_size); FILE *file = fopen(iconfile, "rb"); @@ -5792,7 +5792,7 @@ struct stat st; const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc)); if (iconfile == NULL) { - /* Set an empty icon, or something */ + aim_ssi_delicon(od->sess); } else if (!stat(iconfile, &st)) { char *buf = g_malloc(st.st_size); FILE *file = fopen(iconfile, "rb"); @@ -5811,8 +5811,13 @@ "Can't stat buddy icon file!\n"); } } - } else if (flags == 0x81) - aim_ssi_seticon(od->sess, md5, length); + } else if (flags == 0x81) { + const char *iconfile = gaim_account_get_buddy_icon(gaim_connection_get_account(gc)); + if (iconfile == NULL) + aim_ssi_delicon(od->sess); + else + aim_ssi_seticon(od->sess, md5, length); + } } break; case 0x0002: { /* We just set an "available" message? */ @@ -6684,7 +6689,7 @@ struct stat st; if (iconfile == NULL) { - /* Set an empty icon, or something */ + aim_ssi_delicon(od->sess); } else if (!stat(iconfile, &st)) { char *buf = g_malloc(st.st_size); file = fopen(iconfile, "rb");