0.9.0claws43
[claws.git] / src / folder.c
index ecdbcb628fca0a0843f817b5563b8fb964ee23a0..868cf5073c4d8092d82e8c75190be9e1b082fddf 100644 (file)
@@ -73,6 +73,7 @@ static void folder_get_persist_prefs_recursive
 static gboolean persist_prefs_free     (gpointer key, gpointer val, gpointer data);
 void folder_item_read_cache            (FolderItem *item);
 void folder_item_free_cache            (FolderItem *item);
+gint folder_item_scan_full             (FolderItem *item, gboolean filtering);
 
 static GSList *classlist;
 
@@ -411,7 +412,7 @@ gboolean folder_scan_tree_func(GNode *node, gpointer data)
        FolderItem *item = (FolderItem *)node->data;
        
        folder_item_restore_persist_prefs(item, pptable);
-       folder_item_scan(item);
+       folder_item_scan_full(item, FALSE);
 
        return FALSE;
 }
@@ -971,7 +972,7 @@ static gint folder_sort_folder_list(gconstpointer a, gconstpointer b)
 gint folder_item_open(FolderItem *item)
 {
        if(((FOLDER_TYPE(item->folder) == F_IMAP) && !item->no_select) || (FOLDER_TYPE(item->folder) == F_NEWS)) {
-               folder_item_scan(item);
+               folder_item_scan_full(item, TRUE);
        }
 
        /* Processing */
@@ -1016,7 +1017,7 @@ void folder_item_close(FolderItem *item)
        folder_item_update(item, F_ITEM_UPDATE_MSGCNT);
 }
 
-gint folder_item_scan(FolderItem *item)
+gint folder_item_scan_full(FolderItem *item, gboolean filtering)
 {
        Folder *folder;
        GSList *folder_list = NULL, *cache_list = NULL;
@@ -1218,7 +1219,8 @@ gint folder_item_scan(FolderItem *item)
                        MsgInfo *msginfo = (MsgInfo *) elem->data;
 
                        msgcache_add_msg(item->cache, msginfo);
-                       if ((item->stype == F_INBOX) &&
+                       if ((filtering == TRUE) &&
+                           (item->stype == F_INBOX) &&
                            (item->folder->account != NULL) && 
                            (item->folder->account->filter_on_recv) &&
                            procmsg_msginfo_filter(msginfo))
@@ -1271,6 +1273,11 @@ gint folder_item_scan(FolderItem *item)
        return 0;
 }
 
+gint folder_item_scan(FolderItem *item)
+{
+       return folder_item_scan_full(item, TRUE);
+}
+
 static gboolean folder_scan_all_items_func(GNode *node, gpointer data)
 {
        FolderItem *item = node->data;
@@ -1386,7 +1393,7 @@ void folder_item_read_cache(FolderItem *item)
        item->cache = msgcache_read_cache(item, cache_file);
        if (!item->cache) {
                item->cache = msgcache_new();
-               folder_item_scan(item);
+               folder_item_scan_full(item, TRUE);
        }
        msgcache_read_mark(item->cache, mark_file);
        g_free(cache_file);
@@ -1630,7 +1637,7 @@ gint folder_item_add_msg(FolderItem *dest, const gchar *file,
 
                 dest->last_num = num;
         } else if (num == 0) {
-               folder_item_scan(dest);
+               folder_item_scan_full(dest, FALSE);
                num = folder_item_get_msg_num_by_file(dest, file);
        }
 
@@ -1878,7 +1885,7 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
                                gchar *file;
 
                                if (!folderscan) {
-                                       folder_item_scan(dest);
+                                       folder_item_scan_full(dest, FALSE);
                                        folderscan = TRUE;
                                }
                                file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);
@@ -2029,7 +2036,7 @@ gint folder_item_copy_msgs_with_dest(FolderItem *dest, GSList *msglist)
                                gchar *file;
 
                                if (!folderscan) {
-                                       folder_item_scan(dest);
+                                       folder_item_scan_full(dest, FALSE);
                                        folderscan = TRUE;
                                }
                                file = folder_item_fetch_msg(msginfo->folder, msginfo->msgnum);