[Commits] [SCM] claws branch, master, updated. 3.9.3-98-g55f26ba

colin at claws-mail.org colin at claws-mail.org
Fri Apr 25 12:25:41 CEST 2014


The branch master of project "claws" (Claws Mail) has been updated
       via  55f26ba28398c67c4658f5c48f21b598356e52ef (commit)
      from  564bd916ef76d7ed91e76ae505221de1df214381 (commit)


- Log -----------------------------------------------------------------
commit 55f26ba28398c67c4658f5c48f21b598356e52ef
Author: Colin Leroy <colin at colino.net>
Date:   Fri Apr 25 12:24:54 2014 +0200

    Change the blueness in Drafts folders to saving drafts as New. It makes
    the folder noticed too, but the user can mark the draft as read if he
    desires.

diff --git a/src/compose.c b/src/compose.c
index 31f818e..aff1723 100644
--- a/src/compose.c
+++ b/src/compose.c
@@ -9788,9 +9788,11 @@ gboolean compose_draft (gpointer data, guint action)
 		goto warn_err;
 	}
 	
+	flag.perm_flags = MSG_NEW|MSG_UNREAD;
 	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;
 
@@ -9851,9 +9853,9 @@ warn_err:
 	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
-			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);
diff --git a/src/folder.c b/src/folder.c
index 4c7a045..0cbbfb0 100644
--- a/src/folder.c
+++ b/src/folder.c
@@ -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)  ||
-		     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);
diff --git a/src/folderview.c b/src/folderview.c
index 3745aeb..db210be 100644
--- a/src/folderview.c
+++ b/src/folderview.c
@@ -1262,43 +1262,6 @@ void folderview_check_new_all(void)
 	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)
@@ -1650,10 +1613,6 @@ static void folderview_update_node(FolderView *folderview, GtkCMCTreeNode *node)
 				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) 
diff --git a/src/plugins/notification/notification_plugin.c b/src/plugins/notification/notification_plugin.c
index dd99d88..4b5be73 100644
--- a/src/plugins/notification/notification_plugin.c
+++ b/src/plugins/notification/notification_plugin.c
@@ -155,6 +155,9 @@ static gboolean my_folder_item_update_hook(gpointer source, gpointer data)
 
   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

-----------------------------------------------------------------------

Summary of changes:
 src/compose.c                                  |    8 +++--
 src/folder.c                                   |    1 -
 src/folderview.c                               |   41 ------------------------
 src/plugins/notification/notification_plugin.c |    3 ++
 4 files changed, 8 insertions(+), 45 deletions(-)


hooks/post-receive
-- 
Claws Mail


More information about the Commits mailing list