changeset 20673:70c2ecd55dd8

Fix a couple bugs related to removing mail notifications.
author Daniel Atallah <daniel.atallah@gmail.com>
date Fri, 28 Sep 2007 02:44:07 +0000
parents 4dd60add6a7c
children d6bcff4b4007
files pidgin/gtknotify.c
diffstat 1 files changed, 6 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/pidgin/gtknotify.c	Fri Sep 28 01:57:55 2007 +0000
+++ b/pidgin/gtknotify.c	Fri Sep 28 02:44:07 2007 +0000
@@ -420,8 +420,6 @@
 	GdkPixbuf *icon;
 	gboolean new_n = TRUE;
 
-	icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM);
-
 	if (count > 0 || clear) {
 		/* Allow only one non-detailed email notification for each account */
 		if (gtk_tree_model_get_iter_first(GTK_TREE_MODEL(treemodel), &iter)) {
@@ -449,6 +447,11 @@
 		}
 	}
 
+	if (clear)
+		return NULL;
+
+	icon = pidgin_create_prpl_icon(account, PIDGIN_PRPL_ICON_MEDIUM);
+
 	if (new_n) {
 		data = g_new0(PidginNotifyMailData, 1);
 		gtk_tree_store_append(treemodel, &iter, NULL);
@@ -550,9 +553,8 @@
 				/* There is no API to clear the headline specifically */
 				/* This will trigger reset_mail_dialog() */
 				pidgin_blist_set_headline(NULL, NULL, NULL, NULL, NULL);
+				return NULL;
 			}
-
-			return NULL;
 		}
 	}