changeset 22830:26b9735a34ae

merge of 'bedd15033893c160df2e861d26520e1ef6afd895' and 'd94973707853b3f6b84dc446eac68f7fd4c9370d'
author Mark Doliner <mark@kingant.net>
date Tue, 06 May 2008 08:06:19 +0000
parents ab2322195dab (current diff) 66914f306712 (diff)
children 9089d36d64c9
files
diffstat 4 files changed, 30 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- 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
--- 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;
 }
 
--- 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)));
--- 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);