Fixes NB#124313, remove new email notifications when the account is removed
authorSergio Villar Senin <svillar@igalia.com>
Wed, 24 Jun 2009 16:09:07 +0000 (18:09 +0200)
committerSergio Villar Senin <svillar@igalia.com>
Wed, 24 Jun 2009 16:09:32 +0000 (18:09 +0200)
src/modest-ui-actions.c

index c69a15e..d4353b3 100644 (file)
@@ -6864,8 +6864,15 @@ modest_ui_actions_on_delete_account (GtkWindow *parent_window,
                g_free (default_account_name);
 
                removed = modest_account_mgr_remove_account (account_mgr, account_name);
-               if (!removed)
+               if (removed) {
+                       /* Close all email notifications, we cannot
+                          distinguish if the notification belongs to
+                          this account or not, so for safety reasons
+                          we remove them all */
+                       modest_platform_remove_new_mail_notifications (FALSE);
+               } else {
                        g_warning ("%s: modest_account_mgr_remove_account() failed.\n", __FUNCTION__);
+               }
        }
        return removed;
 }