# HG changeset patch # User Mark Doliner # Date 1210061179 0 # Node ID 26b9735a34ae00c501f0b6a7bdd9f15e1e6164ad # Parent ab2322195dab27b07e4448aa5d228233fc74a291# Parent 66914f306712d67b607f22a2127058deee4ef4b3 merge of 'bedd15033893c160df2e861d26520e1ef6afd895' and 'd94973707853b3f6b84dc446eac68f7fd4c9370d' diff -r ab2322195dab -r 26b9735a34ae ChangeLog --- a/ChangeLog Mon May 05 09:22:46 2008 +0000 +++ b/ChangeLog Tue May 06 08:06:19 2008 +0000 @@ -9,6 +9,8 @@ switching between different operating systems. * Fix reception of IRC PART without a part message on Undernet (fixes a problem with litter in the channel user list). + * IRC no longer crashes on /list on servers which erroneously omit + RPL_LISTSTART. Pidgin: * The typing notification in the conversation history can be disabled or diff -r ab2322195dab -r 26b9735a34ae finch/gntrequest.c --- a/finch/gntrequest.c Mon May 05 09:22:46 2008 +0000 +++ b/finch/gntrequest.c Tue May 06 08:06:19 2008 +0000 @@ -98,6 +98,8 @@ * cb: the callback * data: data for the callback * (text, primary-callback) pairs, ended by a NULL + * + * The cancellation callback should be the last callback sent. */ static GntWidget * setup_button_box(GntWidget *win, gpointer userdata, gpointer cb, gpointer data, ...) @@ -122,6 +124,8 @@ g_signal_connect(G_OBJECT(button), "activate", G_CALLBACK(cb), data); } + g_object_set_data(G_OBJECT(button), "cancellation-function", GINT_TO_POINTER(TRUE)); + va_end(list); return box; } @@ -300,7 +304,7 @@ { PurpleRequestFieldGroup *group = list->data; GList *fields = purple_request_field_group_get_fields(group); - + for (; fields ; fields = fields->next) { PurpleRequestField *field = fields->data; @@ -369,7 +373,8 @@ purple_notify_close_with_handle(button); - if (!purple_request_fields_all_required_filled(fields)) { + if (!g_object_get_data(G_OBJECT(button), "cancellation-function") && + !purple_request_fields_all_required_filled(fields)) { purple_notify_error(button, _("Error"), _("You must fill all the required fields."), _("The required fields are underlined.")); @@ -653,7 +658,7 @@ } g_object_set_data(G_OBJECT(window), "fields", allfields); - + return window; } diff -r ab2322195dab -r 26b9735a34ae libpurple/protocols/irc/msgs.c --- a/libpurple/protocols/irc/msgs.c Mon May 05 09:22:46 2008 +0000 +++ b/libpurple/protocols/irc/msgs.c Tue May 06 08:06:19 2008 +0000 @@ -422,6 +422,11 @@ if (!args[0] || !args[1] || !args[2] || !args[3]) return; + if (!purple_roomlist_get_in_progress(irc->roomlist)) { + purple_debug_warning("irc", "Buggy server didn't send RPL_LISTSTART.\n"); + purple_roomlist_set_in_progress(irc->roomlist, TRUE); + } + room = purple_roomlist_room_new(PURPLE_ROOMLIST_ROOMTYPE_ROOM, args[1], NULL); purple_roomlist_room_add_field(irc->roomlist, room, args[1]); purple_roomlist_room_add_field(irc->roomlist, room, GINT_TO_POINTER(strtol(args[2], NULL, 10))); diff -r ab2322195dab -r 26b9735a34ae pidgin/gtknotify.c --- a/pidgin/gtknotify.c Mon May 05 09:22:46 2008 +0000 +++ b/pidgin/gtknotify.c Tue May 06 08:06:19 2008 +0000 @@ -52,6 +52,7 @@ GtkWidget *label; GtkTreeIter iter; int count; + gboolean purple_has_handle; } PidginNotifyMailData; typedef struct @@ -100,6 +101,8 @@ const char **froms, const char **tos, const char **urls); +static void pidgin_close_notify(PurpleNotifyType type, void *ui_handle); + static void message_response_cb(GtkDialog *dialog, gint id, GtkWidget *widget) { @@ -144,7 +147,10 @@ purple_notify_uri(NULL, data->url); gtk_tree_store_remove(dialog->treemodel, &iter); - purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + if (data->purple_has_handle) + purple_notify_close(PURPLE_NOTIFY_EMAILS, data); + else + pidgin_close_notify(PURPLE_NOTIFY_EMAILS, data); } } gtk_widget_destroy(dialog->dialog); @@ -465,6 +471,7 @@ if (new_n) { data = g_new0(PidginNotifyMailData, 1); + data->purple_has_handle = TRUE; gtk_tree_store_append(treemodel, &iter, NULL); } @@ -479,6 +486,8 @@ data->iter = iter; /* XXX: Do we use this for something? */ data->account = account; data->count = count; + + /* Why is this necessary?*/ gtk_tree_model_get(GTK_TREE_MODEL(treemodel), &iter, PIDGIN_MAIL_DATA, &data, -1); if (icon) @@ -540,6 +549,9 @@ g_free(from_text); g_free(subject_text); + /* If we don't keep track of this, will leak "data" for each of the notifications except the last */ + if (data) + data->purple_has_handle = FALSE; data = pidgin_notify_add_mail(mail_dialog->treemodel, account, notification, urls ? *urls : NULL, 0, FALSE); g_free(notification); @@ -588,7 +600,7 @@ } else if (!GTK_WIDGET_HAS_FOCUS(dialog)) pidgin_set_urgent(GTK_WINDOW(dialog), TRUE); - return NULL; + return data; } static gboolean @@ -807,6 +819,7 @@ col_types[i] = G_TYPE_STRING; } model = gtk_list_store_newv(col_num, col_types); + g_free(col_types); /* Setup the scrolled window containing the treeview */ sw = gtk_scrolled_window_new(NULL, NULL);