From: Mark D. <the...@us...> - 2003-01-08 08:18:52
|
Update of /cvsroot/gaim/gaim/src/protocols/toc In directory sc8-pr-cvs1:/tmp/cvs-serv2718/src/protocols/toc Modified Files: toc.c Log Message: If anyone is curious, the commit before this fixed a bug which didn't allow you to delete AIM or ICQ people from a deny list. They'll show up when you sign back online, and will be deleteable now. This is a patch from the good Mr. McQueen. "Twofold attack: 1) Make sure all the callback functions don't throw a mental if the gc the dialog was asking about has disappeared. Make sure the functions still free up the data structs as necessary in this case. 2) When setting up a ask dialog, plugins (including prpls) pass in their handle. The ask dialog struct gets kept in a slist. When unloading a plugin or prpl, Gaim checks the handle against the list, and sends a cancel-type message for any outstanding dialogs. Should avoid crashes from non-modal ask dialogs lying around." Yeah, so that's a nice lil' improvement. I also fixed a think where SSI "authorization denied" messages would be gibberish. That was a bug from just a few hours ago. Whoops. Also, since this is like a grown up version of show and tell, I thought this was funny: * Robot101 fixes idiocy <KingAnt> Does that mean I'm going to be nuetered? Index: toc.c =================================================================== RCS file: /cvsroot/gaim/gaim/src/protocols/toc/toc.c,v retrieving revision 1.61 retrieving revision 1.62 diff -u -d -r1.61 -r1.62 --- toc.c 8 Jan 2003 05:52:17 -0000 1.61 +++ toc.c 8 Jan 2003 08:18:49 -0000 1.62 @@ -59,6 +59,8 @@ #include "pixmaps/protocols/oscar/free_icon.xpm" #include "pixmaps/protocols/oscar/wireless_icon.xpm" +static struct prpl *my_protocol = NULL; + /* for win32 compatability */ G_MODULE_IMPORT GSList *connections; @@ -1399,8 +1401,6 @@ return m; } -static struct prpl *my_protocol = NULL; - G_MODULE_EXPORT void toc_init(struct prpl *ret) { struct proto_user_opt *puo; @@ -1933,33 +1933,36 @@ static void toc_accept_ft(struct ft_request *fr) { - GtkWidget *window; - char buf[BUF_LEN]; + if(g_slist_find(connections, fr->gc)) { + GtkWidget *window; + char buf[BUF_LEN]; - struct file_transfer *ft = g_new0(struct file_transfer, 1); - ft->gc = fr->gc; - ft->user = g_strdup(fr->user); - ft->cookie = g_strdup(fr->cookie); - ft->ip = g_strdup(fr->ip); - ft->port = fr->port; - ft->files = fr->files; + struct file_transfer *ft = g_new0(struct file_transfer, 1); + ft->gc = fr->gc; + ft->user = g_strdup(fr->user); + ft->cookie = g_strdup(fr->cookie); + ft->ip = g_strdup(fr->ip); + ft->port = fr->port; + ft->files = fr->files; - ft->window = window = gtk_file_selection_new(_("Gaim - Save As...")); - g_snprintf(buf, sizeof(buf), "%s/%s", gaim_home_dir(), fr->filename ? fr->filename : ""); - gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf); - gtk_signal_connect(GTK_OBJECT(window), "destroy", - GTK_SIGNAL_FUNC(cancel_callback), ft); - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(ft->window)->cancel_button), "clicked", - GTK_SIGNAL_FUNC(cancel_callback), ft); + ft->window = window = gtk_file_selection_new(_("Gaim - Save As...")); + g_snprintf(buf, sizeof(buf), "%s/%s", gaim_home_dir(), fr->filename ? fr->filename : ""); + gtk_file_selection_set_filename(GTK_FILE_SELECTION(window), buf); + gtk_signal_connect(GTK_OBJECT(window), "destroy", + GTK_SIGNAL_FUNC(cancel_callback), ft); + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(ft->window)->cancel_button), "clicked", + GTK_SIGNAL_FUNC(cancel_callback), ft); - if (!strcmp(fr->UID, FILE_SEND_UID)) - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), "clicked", - GTK_SIGNAL_FUNC(toc_send_file), ft); - else - gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), "clicked", - GTK_SIGNAL_FUNC(toc_get_file), ft); + if (!strcmp(fr->UID, FILE_SEND_UID)) + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), "clicked", + GTK_SIGNAL_FUNC(toc_send_file), ft); + else + gtk_signal_connect(GTK_OBJECT(GTK_FILE_SELECTION(window)->ok_button), "clicked", + GTK_SIGNAL_FUNC(toc_get_file), ft); + + gtk_widget_show(window); + } - gtk_widget_show(window); toc_reject_ft(fr); } @@ -1984,5 +1987,5 @@ } else { g_snprintf(buf, sizeof(buf), _("%s requests you to send them a file"), ft->user); } - do_ask_dialog(buf, NULL, ft, _("Accept"), toc_accept_ft, _("Cancel"), toc_reject_ft, FALSE); + do_ask_dialog(buf, NULL, ft, _("Accept"), toc_accept_ft, _("Cancel"), toc_reject_ft, my_protocol->plug ? my_protocol->plug->handle : NULL, FALSE); } |