/* return the reversed thread tree */
GNode *procmsg_get_thread_tree(GSList *mlist)
{
- GNode *root, *parent, *node, *next, *last;
- GNode *prev; /* CLAWS */
+ GNode *root, *parent, *node, *next;
GHashTable *msgid_table;
GRelation *subject_relation;
MsgInfo *msginfo;
const gchar *msgid;
- const gchar *subject;
root = g_node_new(NULL);
msgid_table = g_hash_table_new(g_str_hash, g_str_equal);
/* complete the unfinished threads */
for (node = root->children; node != NULL; ) {
- prev = node->prev; /* CLAWS: need the last node */
parent = NULL;
next = node->next;
msginfo = (MsgInfo *)node->data;
(parent, parent->children, node);
}
}
- last = (next == NULL) ? prev : node;
node = next;
}
if (prefs_common.thread_by_subject) {
- for (node = last; node && node != NULL;) {
- next = node->prev;
+ for (node = root->children; node && node != NULL;) {
+ next = node->next;
msginfo = (MsgInfo *) node->data;
- /* may not parentize if parent was delivered after childs */
- if (subject != msginfo->subject)
- parent = subject_relation_lookup(subject_relation, msginfo);
- else
- parent = NULL;
+ parent = subject_relation_lookup(subject_relation, msginfo);
- /* the node may already be threaded by IN-REPLY-TO, so go up in the tree to
+ /* the node may already be threaded by IN-REPLY-TO, so go up
+ * in the tree to
find the parent node */
if (parent != NULL) {
if (g_node_is_ancestor(node, parent))
SET_FILTER_KEY("header \"List-Id\"", H_LIST_ID);
extract_list_id_str(*key);
} else if (hentry[H_X_SEQUENCE].body != NULL) {
- gchar *p;
+ guchar *p;
SET_FILTER_KEY("X-Sequence", H_X_SEQUENCE);
p = *key;
if (msginfo->refcnt > 0)
return;
- debug_print("freeing msginfo %d in %s\n", msginfo->msgnum, msginfo->folder ? msginfo->folder->path : "(nil)");
-
if (msginfo->to_folder) {
msginfo->to_folder->op_count--;
folder_item_update(msginfo->to_folder, F_ITEM_UPDATE_MSGCNT);