0.8.8claws110
[claws.git] / src / folder.c
index 6b65078740d65fb275d3fdbe1727dcb8a6025854..e4eb3c06b39b5bd321347299605f3c5db4419d47 100644 (file)
@@ -1682,7 +1682,7 @@ gint folder_item_move_msg(FolderItem *dest, MsgInfo *msginfo)
 
        num = folder->copy_msg(folder, dest, msginfo);
        
-       if (num != -1) {
+       if (num > 0) {
                MsgInfo *newmsginfo;
     
                /* Add new msginfo to dest folder */
@@ -1715,9 +1715,9 @@ gint folder_item_move_msg(FolderItem *dest, MsgInfo *msginfo)
                                               msginfo->msgnum);
                        msgcache_remove_msg(msginfo->folder->cache, msginfo->msgnum);
 
-                       if (MSG_IS_NEW(msginfo->flags))
+                       if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                                msginfo->folder->new--;
-                       if (MSG_IS_UNREAD(msginfo->flags))
+                       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                                msginfo->folder->unread--;
                        if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                msginfo->folder->unreadmarked--;
@@ -1796,7 +1796,7 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
 
                num = GPOINTER_TO_INT(l2->data);
 
-               if (num != -1) {
+               if (num > 0) {
                        MsgInfo *newmsginfo;
 
                        newmsginfo = folder->get_msginfo(folder, dest, num);
@@ -1838,7 +1838,7 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
 
                num = GPOINTER_TO_INT(l2->data);
                
-               if (num != -1) {
+               if (num > 0) {
                        item->folder->remove_msg(item->folder,
                                                 msginfo->folder,
                                                 msginfo->msgnum);
@@ -1846,9 +1846,9 @@ gint folder_item_move_msgs_with_dest(FolderItem *dest, GSList *msglist)
                                folder_item_read_cache(item);
                        msgcache_remove_msg(item->cache, msginfo->msgnum);
 
-                       if (MSG_IS_NEW(msginfo->flags))
+                       if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                                msginfo->folder->new--;
-                       if (MSG_IS_UNREAD(msginfo->flags))
+                       if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                                msginfo->folder->unread--;
                        if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                                msginfo->folder->unreadmarked--;
@@ -1901,7 +1901,7 @@ gint folder_item_copy_msg(FolderItem *dest, MsgInfo *msginfo)
        if (!dest->cache) folder_item_read_cache(dest);
        
        num = folder->copy_msg(folder, dest, msginfo);
-       if (num != -1) {
+       if (num > 0) {
                MsgInfo *newmsginfo;
 
                if (NULL != (newmsginfo = folder->get_msginfo(folder, dest, num))) {
@@ -1993,7 +1993,7 @@ gint folder_item_copy_msgs_with_dest(FolderItem *dest, GSList *msglist)
 
                num = GPOINTER_TO_INT(l2->data);
 
-               if (num != -1) {
+               if (num > 0) {
                        MsgInfo *newmsginfo;
 
                        newmsginfo = folder->get_msginfo(folder, dest, num);
@@ -2046,9 +2046,9 @@ gint folder_item_remove_msg(FolderItem *item, gint num)
 
        msginfo = msgcache_get_msg(item->cache, num);
        if (msginfo != NULL) {
-               if (MSG_IS_NEW(msginfo->flags))
+               if (MSG_IS_NEW(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                        item->new--;
-               if (MSG_IS_UNREAD(msginfo->flags))
+               if (MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_IGNORE_THREAD(msginfo->flags))
                        item->unread--;
                if (MSG_IS_UNREAD(msginfo->flags) && procmsg_msg_has_marked_parent(msginfo))
                        item->unreadmarked--;