Change the blueness in Drafts folders to saving drafts as New. It makes
authorColin Leroy <colin@colino.net>
Fri, 25 Apr 2014 10:24:54 +0000 (12:24 +0200)
committerColin Leroy <colin@colino.net>
Fri, 25 Apr 2014 10:24:54 +0000 (12:24 +0200)
the folder noticed too, but the user can mark the draft as read if he
desires.

src/compose.c
src/folder.c
src/folderview.c
src/plugins/notification/notification_plugin.c

index 31f818e38c5771da9c4b9ba3b465b26577463f25..aff17233ca6749c1faa95210c2064cf78b7433e2 100644 (file)
@@ -9788,9 +9788,11 @@ gboolean compose_draft (gpointer data, guint action)
                goto warn_err;
        }
        
                goto warn_err;
        }
        
+       flag.perm_flags = MSG_NEW|MSG_UNREAD;
        if (compose->targetinfo) {
                target_locked = MSG_IS_LOCKED(compose->targetinfo->flags);
        if (compose->targetinfo) {
                target_locked = MSG_IS_LOCKED(compose->targetinfo->flags);
-               flag.perm_flags = target_locked?MSG_LOCKED:0;
+               if (target_locked) 
+                       flag.perm_flags |= MSG_LOCKED;
        }
        flag.tmp_flags = MSG_DRAFT;
 
        }
        flag.tmp_flags = MSG_DRAFT;
 
@@ -9851,9 +9853,9 @@ warn_err:
        if (newmsginfo) {
                procmsg_msginfo_unset_flags(newmsginfo, ~0, ~0);
                if (target_locked)
        if (newmsginfo) {
                procmsg_msginfo_unset_flags(newmsginfo, ~0, ~0);
                if (target_locked)
-                       procmsg_msginfo_set_flags(newmsginfo, MSG_LOCKED, MSG_DRAFT);
+                       procmsg_msginfo_set_flags(newmsginfo, MSG_NEW|MSG_UNREAD|MSG_LOCKED, MSG_DRAFT);
                else
                else
-                       procmsg_msginfo_set_flags(newmsginfo, 0, MSG_DRAFT);
+                       procmsg_msginfo_set_flags(newmsginfo, MSG_NEW|MSG_UNREAD, MSG_DRAFT);
                if (compose_use_attach(compose) && action != COMPOSE_AUTO_SAVE)
                        procmsg_msginfo_set_flags(newmsginfo, 0,
                                                  MSG_HAS_ATTACHMENT);
                if (compose_use_attach(compose) && action != COMPOSE_AUTO_SAVE)
                        procmsg_msginfo_set_flags(newmsginfo, 0,
                                                  MSG_HAS_ATTACHMENT);
index 4c7a045d89ecf133669a839f6d163e52904b30a8..0cbbfb090695a16382f07a5714cc95df0d9c23c9 100644 (file)
@@ -2438,7 +2438,6 @@ gint folder_item_scan_full(FolderItem *item, gboolean filtering)
                }
                if ((folder_has_parent_of_type(item, F_OUTBOX) ||
                     folder_has_parent_of_type(item, F_QUEUE)  ||
                }
                if ((folder_has_parent_of_type(item, F_OUTBOX) ||
                     folder_has_parent_of_type(item, F_QUEUE)  ||
-                    folder_has_parent_of_type(item, F_DRAFT)  ||
                     folder_has_parent_of_type(item, F_TRASH)) &&
                    (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)))
                        procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
                     folder_has_parent_of_type(item, F_TRASH)) &&
                    (MSG_IS_NEW(msginfo->flags) || MSG_IS_UNREAD(msginfo->flags)))
                        procmsg_msginfo_unset_flags(msginfo, MSG_NEW | MSG_UNREAD, 0);
index 3745aeb4972aad62720b1ab7d45de459dca9d10f..db210be9d23b2e16bc9ebf815fa0bb69354641bc 100644 (file)
@@ -1262,43 +1262,6 @@ void folderview_check_new_all(void)
        inc_unlock();
 }
 
        inc_unlock();
 }
 
-static gboolean folderview_have_children_sub(FolderView *folderview,
-                                            FolderItem *item,
-                                            gboolean in_sub)
-{
-       GNode *node = NULL;
-       
-       if (!item || !item->folder || !item->folder->node)
-               return FALSE;
-               
-       node = item->folder->node;
-       
-       node = g_node_find(node, G_PRE_ORDER, G_TRAVERSE_ALL, item);
-       node = node->children;
-
-       if (in_sub && item->total_msgs > 0) {
-               return TRUE;
-       }
-
-       while (node != NULL) {
-               if (node && node->data) {
-                       FolderItem *next_item = (FolderItem*) node->data;
-                       node = node->next;
-                       if (folderview_have_children_sub(folderview, 
-                                                        next_item, TRUE))
-                               return TRUE;
-               }
-       }
-
-       return FALSE;
-}
-
-static gboolean folderview_have_children(FolderView *folderview,
-                                        FolderItem *item)
-{
-       return folderview_have_children_sub(folderview, item, FALSE);
-}
-
 static gboolean folderview_have_new_children_sub(FolderView *folderview,
                                                 FolderItem *item,
                                                 gboolean in_sub)
 static gboolean folderview_have_new_children_sub(FolderView *folderview,
                                                 FolderItem *item,
                                                 gboolean in_sub)
@@ -1650,10 +1613,6 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
                                break;
                        }
                }
                                break;
                        }
                }
-       } else if (folder_has_parent_of_type(item, F_DRAFT)) {
-               use_bold = use_color = item->total_msgs > 0 ||
-                                      (!GTK_CMCTREE_ROW(node)->expanded &&
-                                       folderview_have_children(folderview, item));
        } else {
                /* if unread messages exist, print with bold font */
                use_bold = (item->unread_msgs > 0|| item->new_msgs > 0) 
        } else {
                /* if unread messages exist, print with bold font */
                use_bold = (item->unread_msgs > 0|| item->new_msgs > 0) 
index dd99d887c43966033ca4313c95a03eae8ddb9d8b..4b5be733571e700d42005897276ef231a659be02 100644 (file)
@@ -155,6 +155,9 @@ static gboolean my_folder_item_update_hook(gpointer source, gpointer data)
 
   g_return_val_if_fail(source != NULL, FALSE);
 
 
   g_return_val_if_fail(source != NULL, FALSE);
 
+  if (folder_has_parent_of_type(update_data->item, F_DRAFT))
+      return FALSE;
+
 #if defined(NOTIFICATION_LCDPROC) || defined(NOTIFICATION_TRAYICON) || defined(NOTIFICATION_INDICATOR)
     notification_update_msg_counts(NULL);
 #else
 #if defined(NOTIFICATION_LCDPROC) || defined(NOTIFICATION_TRAYICON) || defined(NOTIFICATION_INDICATOR)
     notification_update_msg_counts(NULL);
 #else