2007-01-22 [colin] 2.7.1cvs50
authorColin Leroy <colin@colino.net>
Mon, 22 Jan 2007 17:51:22 +0000 (17:51 +0000)
committerColin Leroy <colin@colino.net>
Mon, 22 Jan 2007 17:51:22 +0000 (17:51 +0000)
* src/procmsg.c
* src/procmsg.h
* src/plugins/bogofilter/bogofilter.c
* src/plugins/bogofilter/bogofilter_gtk.c
* src/plugins/spamassassin/spamassassin.c
* src/plugins/spamassassin/spamassassin_gtk.c
Allow moving spams to the account's trash
instead of default one

ChangeLog
PATCHSETS
configure.ac
src/plugins/bogofilter/bogofilter.c
src/plugins/bogofilter/bogofilter_gtk.c
src/plugins/spamassassin/spamassassin.c
src/plugins/spamassassin/spamassassin_gtk.c
src/procmsg.c
src/procmsg.h

index 9f2008b..3f86027 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+2007-01-22 [colin]     2.7.1cvs50
+
+       * src/procmsg.c
+       * src/procmsg.h
+       * src/plugins/bogofilter/bogofilter.c
+       * src/plugins/bogofilter/bogofilter_gtk.c
+       * src/plugins/spamassassin/spamassassin.c
+       * src/plugins/spamassassin/spamassassin_gtk.c
+               Allow moving spams to the account's trash
+               instead of default one
+
 2007-01-21 [colin]     2.7.1cvs49
 
        * src/ldapquery.c
index 96dffeb..76e5e4b 100644 (file)
--- a/PATCHSETS
+++ b/PATCHSETS
 ( cvs diff -u -r 1.150.2.88 -r 1.150.2.89 src/procmsg.c;  cvs diff -u -r 1.60.2.38 -r 1.60.2.39 src/procmsg.h;  ) > 2.7.1cvs47.patchset
 ( cvs diff -u -r 1.3.2.13 -r 1.3.2.14 src/ldapquery.c;  cvs diff -u -r 1.4.2.7 -r 1.4.2.8 src/ldapquery.h;  ) > 2.7.1cvs48.patchset
 ( cvs diff -u -r 1.3.2.14 -r 1.3.2.15 src/ldapquery.c;  cvs diff -u -r 1.4.2.8 -r 1.4.2.9 src/ldapquery.h;  ) > 2.7.1cvs49.patchset
+( cvs diff -u -r 1.150.2.89 -r 1.150.2.90 src/procmsg.c;  cvs diff -u -r 1.60.2.39 -r 1.60.2.40 src/procmsg.h;  cvs diff -u -r 1.1.2.24 -r 1.1.2.25 src/plugins/bogofilter/bogofilter.c;  cvs diff -u -r 1.1.2.16 -r 1.1.2.17 src/plugins/bogofilter/bogofilter_gtk.c;  cvs diff -u -r 1.18.2.46 -r 1.18.2.47 src/plugins/spamassassin/spamassassin.c;  cvs diff -u -r 1.23.2.35 -r 1.23.2.36 src/plugins/spamassassin/spamassassin_gtk.c;  ) > 2.7.1cvs50.patchset
index 497f8ec..760f139 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=7
 MICRO_VERSION=1
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=49
+EXTRA_VERSION=50
 EXTRA_RELEASE=
 EXTRA_GTK2_VERSION=
 
index d0a3704..94f9c9d 100644 (file)
@@ -584,12 +584,20 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                mail_filtering_data->unfiltered = NULL;
        } else {
                if (config.receive_spam && new_spams) {
-                       FolderItem *save_folder;
+                       FolderItem *save_folder = NULL;
 
                        if ((!config.save_folder) ||
                            (config.save_folder[0] == '\0') ||
-                           ((save_folder = folder_find_item_from_identifier(config.save_folder)) == NULL))
-                               save_folder = folder_get_default_trash();
+                           ((save_folder = folder_find_item_from_identifier(config.save_folder)) == NULL)) {
+                               if (mail_filtering_data->account && mail_filtering_data->account->set_trash_folder)
+                                       save_folder = folder_find_item_from_identifier(
+                                               mail_filtering_data->account->trash_folder);
+                               if (save_folder == NULL && mail_filtering_data->account &&
+                                   mail_filtering_data->account->folder)
+                                       save_folder = mail_filtering_data->account->folder->trash;
+                               if (save_folder == NULL)
+                                       save_folder = folder_get_default_trash();
+                       }
                        if (save_folder) {
                                for (cur = new_spams; cur; cur = cur->next) {
                                        msginfo = (MsgInfo *)cur->data;
@@ -599,12 +607,20 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                        }
                }
                if (config.save_unsure && new_unsure) {
-                       FolderItem *save_unsure_folder;
+                       FolderItem *save_unsure_folder = NULL;
 
                        if ((!config.save_unsure_folder) ||
                            (config.save_unsure_folder[0] == '\0') ||
-                           ((save_unsure_folder = folder_find_item_from_identifier(config.save_unsure_folder)) == NULL))
-                               save_unsure_folder = folder_get_default_inbox();
+                           ((save_unsure_folder = folder_find_item_from_identifier(config.save_unsure_folder)) == NULL)) {
+                               if (mail_filtering_data->account)
+                                       save_unsure_folder = folder_find_item_from_identifier(
+                                               mail_filtering_data->account->inbox);
+                               if (save_unsure_folder == NULL && mail_filtering_data->account &&
+                                   mail_filtering_data->account->folder)
+                                       save_unsure_folder = mail_filtering_data->account->folder->inbox;
+                               if (save_unsure_folder == NULL)
+                                       save_unsure_folder = folder_get_default_inbox();
+                       }
                        if (save_unsure_folder) {
                                for (cur = new_unsure; cur; cur = cur->next) {
                                        msginfo = (MsgInfo *)cur->data;
index 25ae53c..d84f636 100644 (file)
@@ -184,7 +184,7 @@ static void bogofilter_create_widget_func(PrefsPage * _page,
        gtk_widget_show (save_spam_folder_entry);
        gtk_box_pack_start (GTK_BOX (hbox_save_spam), save_spam_folder_entry, TRUE, TRUE, 0);
        gtk_tooltips_set_tip(tooltips, save_spam_folder_entry,
-                       _("Folder for storing identified spam. Leave empty to use the default trash folder."),
+                       _("Folder for storing identified spam. Leave empty to use the trash folder."),
                        NULL);
 
        save_spam_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
@@ -206,7 +206,7 @@ static void bogofilter_create_widget_func(PrefsPage * _page,
        gtk_widget_show (save_unsure_folder_entry);
        gtk_box_pack_start (GTK_BOX (hbox_save_unsure), save_unsure_folder_entry, TRUE, TRUE, 0);
        gtk_tooltips_set_tip(tooltips, save_unsure_folder_entry,
-                       _("Folder for storing mail for which spam status is Unsure. Leave empty to use the default inbox folder."),
+                       _("Folder for storing mail for which spam status is Unsure. Leave empty to use the inbox folder."),
                        NULL);
 
        save_unsure_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
index 425a5be..ff00b75 100644 (file)
@@ -252,13 +252,20 @@ static gboolean mail_filtering_hook(gpointer source, gpointer data)
                debug_print("message is spam\n");
                procmsg_msginfo_set_flags(msginfo, MSG_SPAM, 0);
                if (config.receive_spam) {
-                       FolderItem *save_folder;
+                       FolderItem *save_folder = NULL;
 
                        if ((!config.save_folder) ||
                            (config.save_folder[0] == '\0') ||
-                           ((save_folder = folder_find_item_from_identifier(config.save_folder)) == NULL))
-                               save_folder = folder_get_default_trash();
-
+                           ((save_folder = folder_find_item_from_identifier(config.save_folder)) == NULL)) {
+                               if (mail_filtering_data->account && mail_filtering_data->account->set_trash_folder)
+                                       save_folder = folder_find_item_from_identifier(
+                                               mail_filtering_data->account->trash_folder);
+                               if (save_folder == NULL && mail_filtering_data->account &&
+                                   mail_filtering_data->account->folder)
+                                       save_folder = mail_filtering_data->account->folder->trash;
+                               if (save_folder == NULL)
+                                       save_folder = folder_get_default_trash();
+                       }
                        procmsg_msginfo_unset_flags(msginfo, ~0, 0);
                        procmsg_msginfo_set_flags(msginfo, MSG_SPAM, 0);
                        msginfo->is_move = TRUE;
index 8417847..b78b4c5 100644 (file)
@@ -377,7 +377,7 @@ static void spamassassin_create_widget_func(PrefsPage * _page,
        gtk_widget_show (save_spam_folder_entry);
        gtk_box_pack_start (GTK_BOX (hbox_save_spam), save_spam_folder_entry, TRUE, TRUE, 0);
        gtk_tooltips_set_tip(tooltips, save_spam_folder_entry,
-                       _("Folder for storing identified spam. Leave empty to use the default trash folder."),
+                       _("Folder for storing identified spam. Leave empty to use the trash folder."),
                        NULL);
 
        save_spam_folder_select = gtkut_get_browse_directory_btn(_("_Browse"));
index e1c7e1f..3256084 100644 (file)
@@ -2111,7 +2111,8 @@ static gboolean procmsg_msginfo_filter(MsgInfo *msginfo, PrefsAccount* ac_prefs)
        mail_filtering_data.msginfo = msginfo;                  
        mail_filtering_data.msglist = NULL;                     
        mail_filtering_data.filtered = NULL;                    
-       mail_filtering_data.unfiltered = NULL;                  
+       mail_filtering_data.unfiltered = NULL;
+       mail_filtering_data.account = ac_prefs; 
        if (hooks_invoke(MAIL_FILTERING_HOOKLIST, &mail_filtering_data)) {
                return TRUE;
        }
@@ -2156,6 +2157,7 @@ void procmsg_msglist_filter(GSList *list, PrefsAccount *ac,
        mail_filtering_data.msglist = list;                     
        mail_filtering_data.filtered = NULL;                    
        mail_filtering_data.unfiltered = NULL;  
+       mail_filtering_data.account = ac;       
                        
        hooks_invoke(MAIL_LISTFILTERING_HOOKLIST, &mail_filtering_data);
        
index bbd9531..5ddd9ed 100644 (file)
@@ -264,6 +264,7 @@ struct _MailFilteringData
        GSList  *msglist;
        GSList  *filtered;
        GSList  *unfiltered;
+       PrefsAccount *account;
 };
 
 GSList *procmsg_read_cache             (FolderItem     *item,