0.8.11claws79
authorChristoph Hohmann <reboot@gmx.ch>
Tue, 8 Apr 2003 20:47:42 +0000 (20:47 +0000)
committerChristoph Hohmann <reboot@gmx.ch>
Tue, 8 Apr 2003 20:47:42 +0000 (20:47 +0000)
* src/folder.c
* src/prefs_account.c
        Filter new messages that are found in an INBOX folder
        when 'Filter messages on receiving' is enabled in the
        Folder's AccountPrefs. This allows to use Sylpheed's
        filtering engine for IMAP folders where messages are
        added to the INBOX by a MTA

ChangeLog.claws
configure.ac
src/folder.c
src/prefs_account.c

index 27da2b0bd00a4a9f67fbd879bcaf8326a508fa58..2404063baf0d79eda57ea85ec1960367a54aaf87 100644 (file)
@@ -1,3 +1,13 @@
+2003-04-08 [christoph] 0.8.11claws79
+
+       * src/folder.c
+       * src/prefs_account.c
+               Filter new messages that are found in an INBOX folder
+               when 'Filter messages on receiving' is enabled in the
+               Folder's AccountPrefs. This allows to use Sylpheed's
+               filtering engine for IMAP folders where messages are
+               added to the INBOX by a MTA
+
 2003-04-08 [paul]      0.8.11claws78
 
        * src/procmsg.h
index 9466bc902890b1d2e64e0fa4c6b63b1fc87a9938..c17151a846a2b743acc539e2359462eb17c7eaeb 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=11
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws78
+EXTRA_VERSION=claws79
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 28f49c9bd59f7a110904fe23fac9fe9fd1d6a413..0761f254b4a23085aa7fbc94d991ef4d575522c4 100644 (file)
@@ -1206,12 +1206,21 @@ gint folder_item_scan(FolderItem *item)
        if (newmsg_list != NULL) {
                GSList *elem;
 
-               for (elem = newmsg_list; elem != NULL; elem = g_slist_next(elem))
-                       msgcache_add_msg(item->cache, elem->data);
+               for (elem = newmsg_list; elem != NULL; elem = g_slist_next(elem)) {
+                       MsgInfo *msginfo = (MsgInfo *) elem->data;
+
+                       msgcache_add_msg(item->cache, msginfo);
+                       if ((item->stype == F_INBOX) &&
+                           (item->folder->account != NULL) && 
+                           (item->folder->account->filter_on_recv) &&
+                           procmsg_msginfo_filter(msginfo))
+                               procmsg_msginfo_free(msginfo);
+                       else
+                               exists_list = g_slist_prepend(exists_list, msginfo);
+               }
+               g_slist_free(newmsg_list);
 
                update_flags |= F_ITEM_UPDATE_MSGCNT | F_ITEM_UPDATE_CONTENT;
-               
-               exists_list = g_slist_concat(exists_list, newmsg_list);
        }
 
        for (elem = exists_list; elem != NULL; elem = g_slist_next(elem)) {
index dba5f8c52d2121e4d139a713d91c5656ca10d04f..549828e53fab85e0621af9e5d63e8efaf3d4a9bc 100644 (file)
@@ -91,11 +91,11 @@ static struct Receive {
        GtkWidget *getall_chkbtn;
        GtkWidget *size_limit_chkbtn;
        GtkWidget *size_limit_entry;
-       GtkWidget *filter_on_recv_chkbtn;
        GtkWidget *inbox_label;
        GtkWidget *inbox_entry;
        GtkWidget *inbox_btn;
 
+       GtkWidget *filter_on_recv_chkbtn;
        GtkWidget *recvatgetall_chkbtn;
 
        GtkWidget *frame_maxarticle;
@@ -1187,9 +1187,6 @@ static void prefs_account_receive_create(void)
 
        SET_TOGGLE_SENSITIVITY (size_limit_chkbtn, size_limit_entry);
 
-       PACK_CHECK_BUTTON (vbox2, filter_on_recv_chkbtn,
-                          _("Filter messages on receiving"));
-
        PACK_VSPACER(vbox2, vbox3, VSPACING_NARROW_2);
 
        hbox1 = gtk_hbox_new (FALSE, 8);
@@ -1248,6 +1245,8 @@ static void prefs_account_receive_create(void)
        gtk_box_pack_start (GTK_BOX (hbox2), label_maxarticle, FALSE, FALSE, 0);
        gtk_label_set_justify (GTK_LABEL (label_maxarticle), GTK_JUSTIFY_LEFT);
 
+       PACK_CHECK_BUTTON (vbox1, filter_on_recv_chkbtn,
+                          _("Filter messages on receiving"));
 
        PACK_CHECK_BUTTON
                (vbox1, recvatgetall_chkbtn,