don't thread a node by subject if it has already been threaded by subject
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 10 Nov 2001 23:24:05 +0000 (23:24 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sat, 10 Nov 2001 23:24:05 +0000 (23:24 +0000)
ChangeLog.claws
configure.in
src/procmsg.c

index 85eac95c23f59f1ff8c71d9c3df5e8e4cac95c61..dffb863995cc8d11f982137d77a3162280c43511 100644 (file)
@@ -1,9 +1,16 @@
+2001-11-11 [alfons]    0.6.5.claws5
+
+       * src/procmsg.c
+               prevent threading by subject on nodes that have already been
+               threaded by in-reply-to (as in "circular references in a tree
+               result in a dead branch")
+
 2001-11-09 [hoa]       0.6.5.claws4
        
        * src/folderview.c
                allows creation of mbox folder item from any files.
 
-2001-11-07 [alfons]    0.6.5.claws3
+2001-11-09 [alfons]    0.6.5.claws3
        
        * src/utils.c
        * src/procmsg.c
index 2fcb3d09e7000abbedc941578a79d7786bd7bed0..90653fbe045d43208c941b8a3edd5ee91ba9e267 100644 (file)
@@ -8,7 +8,7 @@ MINOR_VERSION=6
 MICRO_VERSION=5
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws3
+EXTRA_VERSION=claws4
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl
index 5b74a8b3d7ca9c5240980f96e549b67e41b97b5c..5628c33affb7868b88d2baa8db37f4fce8df6706 100644 (file)
@@ -545,12 +545,9 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
                next = node->next;
                msginfo = (MsgInfo *)node->data;
                parent = NULL;
-
-               if (msginfo->inreplyto)
+               /* CLAWS: ignore thread */
+               if (msginfo->inreplyto) 
                        parent = g_hash_table_lookup(msgid_table, msginfo->inreplyto);
-               if (parent == NULL && subject_is_reply(msginfo->subject))
-                       parent = subject_table_lookup(subject_table, msginfo->subject);
-               
                if (parent && parent != node) {
                        g_node_unlink(node);
                        g_node_insert_before
@@ -562,6 +559,29 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
                node = next;
        }
 
+       /* CLAWS: now see if the first level (below root) still has some nodes that can be
+        * threaded by subject line. we need to handle this in a special way to prevent
+        * circular reference from a node that has already been threaded by IN-REPLY-TO
+        * but is also in the subject line hash table */
+       for (node = root->children; node != NULL; ) {
+               next = node->next;
+               msginfo = (MsgInfo *) node->data;
+               parent = NULL;
+               if (subject_is_reply(msginfo->subject)) {
+                       if (NULL != (parent = subject_table_lookup(subject_table, msginfo->subject))) {
+                               /* the node may already be threaded by IN-REPLY-TO, so go up in the 
+                                * tree to find the parent node */
+                               for (; parent->parent && parent->parent != root; parent = parent->parent) 
+                                       ;
+                       }                                       
+               }                                       
+               if (parent && parent != node) {
+                       g_node_unlink(node);
+                       g_node_append(parent, node);
+               }
+               node = next;
+       }               
+               
        g_hash_table_destroy(subject_table);
        g_hash_table_destroy(msgid_table);