* src/compose.c
[claws.git] / src / procmsg.c
index 8e0fad864c973fa3689943b23a09abb98bfc6557..b47af18f66152988ac7b58864a9e88ab98b47dcb 100644 (file)
@@ -899,7 +899,7 @@ gint procmsg_send_queue(FolderItem *queue, gboolean save_msgs)
                procmsg_msginfo_free(msginfo);
        }
 
-       folderview_update_item(queue, FALSE);
+       folder_update_item(queue, FALSE);
 
        return ret;
 }
@@ -1112,8 +1112,7 @@ MsgInfo *procmsg_msginfo_get_full_info(MsgInfo *msginfo)
        full_msginfo->decryption_failed = msginfo->decryption_failed;
 #endif
 
-       /* return full_msginfo;*/
-       return procmsg_msginfo_new_ref(msginfo);
+       return full_msginfo;
 }
 
 void procmsg_msginfo_free(MsgInfo *msginfo)
@@ -1432,7 +1431,6 @@ msginfo->folder->folder->change_flags(msginfo->folder->folder, \
 
 void procmsg_msginfo_set_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgTmpFlags tmp_flags)
 {
-       gboolean changed = FALSE;
        FolderItem *item = msginfo->folder;
 
        debug_print("Setting flags for message %d in folder %s\n", msginfo->msgnum, item->path);
@@ -1441,25 +1439,25 @@ void procmsg_msginfo_set_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgTmp
        if ((perm_flags & MSG_NEW) && !MSG_IS_NEW(msginfo->flags) &&
           !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                item->new++;
-               changed = TRUE;
+               item->need_update = TRUE;
        }
 
        /* if unread flag is set */
        if ((perm_flags & MSG_UNREAD) && !MSG_IS_UNREAD(msginfo->flags) &&
           !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                item->unread++;
-               changed = TRUE;
+               item->need_update = TRUE;
        }
 
        /* if ignore thread flag is set */
        if ((perm_flags & MSG_IGNORE_THREAD) && !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                if (MSG_IS_NEW(msginfo->flags) || (perm_flags & MSG_NEW)) {
                        item->new--;
-                       changed = TRUE;
+                       item->need_update = TRUE;
                }
                if (MSG_IS_UNREAD(msginfo->flags) || (perm_flags & MSG_UNREAD)) {
                        item->unread--;
-                       changed = TRUE;
+                       item->need_update = TRUE;
                }
        }
 
@@ -1469,16 +1467,12 @@ void procmsg_msginfo_set_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgTmp
        msginfo->flags.perm_flags |= perm_flags;
        msginfo->flags.tmp_flags |= tmp_flags;
 
-       if (changed) {
-               folderview_update_item(item, FALSE);
-       }
        CHANGE_FLAGS(msginfo);
        procmsg_msginfo_write_flags(msginfo);
 }
 
 void procmsg_msginfo_unset_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgTmpFlags tmp_flags)
 {
-       gboolean changed = FALSE;
        FolderItem *item = msginfo->folder;
        
        debug_print("Unsetting flags for message %d in folder %s\n", msginfo->msgnum, item->path);
@@ -1487,25 +1481,25 @@ void procmsg_msginfo_unset_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgT
        if ((perm_flags & MSG_NEW) && MSG_IS_NEW(msginfo->flags) &&
           !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                item->new--;
-               changed = TRUE;
+               item->need_update = TRUE;
        }
 
        /* if unread flag is unset */
        if ((perm_flags & MSG_UNREAD) && MSG_IS_UNREAD(msginfo->flags) &&
           !MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                item->unread--;
-               changed = TRUE;
+               item->need_update = TRUE;
        }
 
        /* if ignore thread flag is unset */
        if ((perm_flags & MSG_IGNORE_THREAD) && MSG_IS_IGNORE_THREAD(msginfo->flags)) {
                if (MSG_IS_NEW(msginfo->flags) && !(perm_flags & MSG_NEW)) {
                        item->new++;
-                       changed = TRUE;
+                       item->need_update = TRUE;
                }
                if (MSG_IS_UNREAD(msginfo->flags) && !(perm_flags & MSG_UNREAD)) {
                        item->unread++;
-                       changed = TRUE;
+                       item->need_update = TRUE;
                }
        }
 
@@ -1515,8 +1509,6 @@ void procmsg_msginfo_unset_flags(MsgInfo *msginfo, MsgPermFlags perm_flags, MsgT
        msginfo->flags.perm_flags &= ~perm_flags;
        msginfo->flags.tmp_flags &= ~tmp_flags;
 
-       if (changed) 
-               folderview_update_item(item, FALSE);
        CHANGE_FLAGS(msginfo);
        procmsg_msginfo_write_flags(msginfo);
 }