Deletion of duplicates now prefer deleting
authorColin Leroy <colin@colino.net>
Mon, 25 Nov 2002 14:58:25 +0000 (14:58 +0000)
committerColin Leroy <colin@colino.net>
Mon, 25 Nov 2002 14:58:25 +0000 (14:58 +0000)
the unread dup (fixes feature-request 638989).

ChangeLog.claws
configure.in
src/summaryview.c

index a349ad218f6f07388df415deefed4fe952517460..a2f7cc72c4085217d9b6a86a2e31712c6efa1b12 100644 (file)
@@ -1,3 +1,9 @@
+2002-11-25 [colin]     0.8.6claws1
+
+       * src/summaryview.c
+               Deletion of duplicates now prefer deleting
+               the unread dup (fixes feature-request 638989).
+
 2002-11-24 [paul]      0.8.6claws
 
        * po/es.po
index 1feda1b626041938f5f10d722864d677890ed757..614abec31a4f15020e41b3625a58177f750e35b7 100644 (file)
@@ -11,7 +11,7 @@ MINOR_VERSION=8
 MICRO_VERSION=6
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws
+EXTRA_VERSION=claws1
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index 95131b07af5aeff4dc20db2185223ed65d7574ba..8a2b54612b29a8a0bac51f137cedfe6452cf6c85 100644 (file)
@@ -2988,13 +2988,19 @@ static void summary_delete_duplicated_func(GtkCTree *ctree, GtkCTreeNode *node,
 {
        GtkCTreeNode *found;
        MsgInfo *msginfo = GTK_CTREE_ROW(node)->row.data;
-
+       MsgInfo *dup_msginfo;
+       
        if (!msginfo->msgid || !*msginfo->msgid) return;
 
        found = g_hash_table_lookup(summaryview->msgid_table, msginfo->msgid);
-
-       if (found && found != node)
-               summary_delete_row(summaryview, node);
+       
+       if (found && found != node) {
+               dup_msginfo = gtk_ctree_node_get_row_data(ctree, found);
+               /* prefer to delete the unread one */
+               if ((MSG_IS_UNREAD(msginfo->flags) && !MSG_IS_UNREAD(dup_msginfo->flags))
+               ||  (MSG_IS_UNREAD(msginfo->flags) == MSG_IS_UNREAD(dup_msginfo->flags)))
+                       summary_delete_row(summaryview, node);
+       }
 }
 
 static void summary_unmark_row(SummaryView *summaryview, GtkCTreeNode *row)