0.8.8claws18
[claws.git] / src / folder.c
index 1bcc1c1b4564046d304751cdfb7cda4465cb1c8b..8a18558ee32a564806e863b6152e6f85362d36fc 100644 (file)
 #include "utils.h"
 #include "xml.h"
 #include "codeconv.h"
-#include "prefs.h"
+#include "prefs_gtk.h"
 #include "account.h"
 #include "filtering.h"
 #include "scoring.h"
 #include "prefs_folder_item.h"
 #include "procheader.h"
-#include "statusbar.h"
 #include "hooks.h"
 #include "log.h"
 
@@ -1147,6 +1146,8 @@ gint folder_item_scan(FolderItem *item)
                                                unreadcnt++;
                                        if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
                                                unreadmarkedcnt++;
+                                       if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+                                               procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
                                        procmsg_msginfo_free(newmsginfo);
                                }                                       
 
@@ -1158,6 +1159,8 @@ gint folder_item_scan(FolderItem *item)
                                        unreadcnt++;
                                if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                        unreadmarkedcnt++;
+                               if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+                                       procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
                        }
                        totalcnt++;
                        procmsg_msginfo_free(msginfo);
@@ -1205,6 +1208,8 @@ gint folder_item_scan(FolderItem *item)
                                        unreadcnt++;
                                if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                        unreadmarkedcnt++;
+                               if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+                                       procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
                                totalcnt++;
                                procmsg_msginfo_free(msginfo);
                        }
@@ -1227,6 +1232,8 @@ gint folder_item_scan(FolderItem *item)
                                    unreadcnt++;
                                if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                        unreadmarkedcnt++;
+                               if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+                                       procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
                                totalcnt++;
                                procmsg_msginfo_free(msginfo);
                                debug_print("Added newly found message %d to cache.\n", num);
@@ -1479,6 +1486,8 @@ gint folder_item_add_msg(FolderItem *dest, const gchar *file,
                                dest->unread++;
                        if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                dest->unreadmarked++;
+                       if (procmsg_msg_has_flagged_parent(msginfo, MSG_IGNORE_THREAD))
+                               procmsg_msginfo_set_flags(msginfo, MSG_IGNORE_THREAD, 0);
                        dest->total++;
                        dest->need_update = TRUE;
 
@@ -1536,7 +1545,6 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
                new_item->folder = dest->folder;
 
        /* move messages */
-       statusbar_verbosity_set(TRUE);
        for (cur = mlist ; cur != NULL ; cur = cur->next) {
                MsgInfo * msginfo;
                cnt++;
@@ -1549,7 +1557,6 @@ FolderItem *folder_item_move_recursive (FolderItem *src, FolderItem *dest)
 
                procmsg_msginfo_free(msginfo);
        }
-       statusbar_verbosity_set(FALSE);
        
        /*copy prefs*/
        prefs_folder_item_copy_prefs(src, new_item);
@@ -1693,6 +1700,8 @@ gint folder_item_move_msg(FolderItem *dest, MsgInfo *msginfo)
                                dest->unread++;
                        if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
                                dest->unreadmarked++;
+                       if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+                               procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
                        dest->total++;
                        dest->need_update = TRUE;
 
@@ -1806,6 +1815,8 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
                                        dest->unread++;
                                if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
                                        dest->unreadmarked++;
+                               if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+                                       procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
                                dest->total++;
                                dest->need_update = TRUE;
 
@@ -1908,6 +1919,8 @@ gint folder_item_copy_msg(FolderItem *dest, MsgInfo *msginfo)
                                dest->unread++;
                        if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
                                dest->unreadmarked++;
+                       if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+                               procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
                        dest->total++;
                        dest->need_update = TRUE;
 
@@ -1999,6 +2012,8 @@ gint folder_item_copy_msgs_with_dest(FolderItem *dest, GSList *msglist)
                                        dest->unread++;
                                if (MSG_IS_UNREAD(newmsginfo->flags) && procmsg_msg_has_marked_parent(newmsginfo))
                                        dest->unreadmarked++;
+                               if (procmsg_msg_has_flagged_parent(newmsginfo, MSG_IGNORE_THREAD))
+                                       procmsg_msginfo_set_flags(newmsginfo, MSG_IGNORE_THREAD, 0);
                                dest->total++;
                                dest->need_update = TRUE;
 
@@ -2248,6 +2263,8 @@ static gboolean folder_build_tree(GNode *node, gpointer data)
                                sort_key = SORT_BY_UNREAD;
                        else if (!strcmp(attr->value, "mime"))
                                sort_key = SORT_BY_MIME;
+                       else if (!strcmp(attr->value, "to"))
+                               sort_key = SORT_BY_TO;
                        else if (!strcmp(attr->value, "locked"))
                                sort_key = SORT_BY_LOCKED;
                } else if (!strcmp(attr->name, "sort_type")) {
@@ -2403,7 +2420,8 @@ static void folder_write_list_recursive(GNode *node, gpointer data)
                                                 "draft", "queue", "trash"};
        static gchar *sort_key_str[] = {"none", "number", "size", "date",
                                        "from", "subject", "score", "label",
-                                       "mark", "unread", "mime", "locked" };
+                                       "mark", "unread", "mime", "to", 
+                                       "locked"};
        g_return_if_fail(node != NULL);
        g_return_if_fail(fp != NULL);