simple fix for putting older nodes before newer nodes when threading by subject
authorAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 30 Jun 2002 21:45:35 +0000 (21:45 +0000)
committerAlfons Hoogervorst <alfons@proteus.demon.nl>
Sun, 30 Jun 2002 21:45:35 +0000 (21:45 +0000)
ChangeLog.claws
configure.in
src/procmsg.c

index 7e35c51e0de3967679af47845ac2da7b38f848b0..53b9bf2d22cf12b9ddd08f47e44923da477b9694 100644 (file)
@@ -1,3 +1,9 @@
+2002-06-30 [alfons]    0.7.8claws38
+
+       * src/procmsg.c
+               simple fix for putting older nodes before
+               newer nodes when threading by subject
+
 2002-06-30 [christoph] 0.7.8claws37
 
        * src/folder.c
index 8beb5d0e204e1bb2419ca20f62202922f458efb9..b97e9564e29d58eed1e47a951feb53cfc3877ce2 100644 (file)
@@ -9,7 +9,7 @@ MINOR_VERSION=7
 MICRO_VERSION=8
 INTERFACE_AGE=0
 BINARY_AGE=0
-EXTRA_VERSION=claws37
+EXTRA_VERSION=claws38
 VERSION=$MAJOR_VERSION.$MINOR_VERSION.$MICRO_VERSION$EXTRA_VERSION
 
 dnl set $target
index df2ee1396f2f17f06255edce3cb68f0a507f12d3..2973bbb2dbcccc19e707e1ed9ee619c0790914fa 100644 (file)
@@ -589,6 +589,7 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
        MsgInfo *msginfo;
        const gchar *msgid;
        const gchar *subject;
+       GNode *found_subject;
 
        root = g_node_new(NULL);
        msgid_table = g_hash_table_new(g_str_hash, g_str_equal);
@@ -616,10 +617,20 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
                        g_hash_table_insert(msgid_table, (gchar *)msgid, node);
 
                subject = msginfo->subject;
-               if (subject_table_lookup(subject_table,
-                                        (gchar *) subject) == NULL)
-                       subject_table_insert(subject_table, (gchar *)subject,
+               found_subject = subject_table_lookup(subject_table,
+                                                    (gchar *) subject);
+               if (found_subject == NULL)
+                       subject_table_insert(subject_table, (gchar *) subject,
                                             node);
+               else {
+                       /* replace if msg in table is older than current one 
+                        * can add here more stuff.  */
+                       if ( ((MsgInfo*)(found_subject->data))->date_t >
+                            ((MsgInfo*)(node->data))->date_t )  {
+                               subject_table_remove(subject_table, (gchar *) subject);
+                               subject_table_insert(subject_table, (gchar *) subject, node);
+                       }       
+               }
        }
 
        /* complete the unfinished threads */