aboutsummaryrefslogtreecommitdiff
path: root/src/procmsg.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-29 04:40:26 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-03-29 04:40:26 +0000
commit877b16da4a494077b72a1e03c62a481151aa80c1 (patch)
tree5b943588242d3a48641b19d8207c27c0fd253302 /src/procmsg.c
parent78ffc1ed2c6fbf42feabfb348d746b5a36be3db8 (diff)
modified message threading.
git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@191 ee746299-78ed-0310-b773-934348b2243d
Diffstat (limited to 'src/procmsg.c')
-rw-r--r--src/procmsg.c24
1 files changed, 9 insertions, 15 deletions
diff --git a/src/procmsg.c b/src/procmsg.c
index 4ff70aec..1a12f096 100644
--- a/src/procmsg.c
+++ b/src/procmsg.c
@@ -695,14 +695,14 @@ static FILE *procmsg_open_data_file(const gchar *file, guint version,
/* check version */
if ((fp = fopen(file, "rb")) == NULL)
- debug_print("Mark/Cache file not found\n");
+ debug_print("Mark/Cache file '%s' not found\n", file);
else {
if (buf && buf_size > 0)
setvbuf(fp, buf, _IOFBF, buf_size);
if (fread(&data_ver, sizeof(data_ver), 1, fp) != 1 ||
version != data_ver) {
- g_message("Mark/Cache version is different (%u != %u). "
- "Discarding it.\n", data_ver, version);
+ g_message("%s: Mark/Cache version is different (%u != %u). Discarding it.\n",
+ file, data_ver, version);
fclose(fp);
fp = NULL;
}
@@ -779,22 +779,15 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
for (; mlist != NULL; mlist = mlist->next) {
msginfo = (MsgInfo *)mlist->data;
- parent = NULL;
+ parent = root;
- if (msginfo->inreplyto)
+ /* only look for the real parent first */
+ if (msginfo->inreplyto) {
parent = g_hash_table_lookup(table, msginfo->inreplyto);
-
- if (!parent && msginfo->references) {
- for (reflist = msginfo->references;
- reflist != NULL; reflist = reflist->next)
- if ((parent = g_hash_table_lookup
- (table, reflist->data)) != NULL)
- break;
+ if (parent == NULL)
+ parent = root;
}
- if (parent == NULL)
- parent = root;
-
node = g_node_insert_data_before
(parent, parent == root ? parent->children : NULL,
msginfo);
@@ -812,6 +805,7 @@ GNode *procmsg_get_thread_tree(GSList *mlist)
if (msginfo->inreplyto)
parent = g_hash_table_lookup(table, msginfo->inreplyto);
+ /* try looking for the indirect parent */
if (!parent && msginfo->references) {
for (reflist = msginfo->references;
reflist != NULL; reflist = reflist->next)