From 49e82f8b9fb67aba12f536c6ea29a640b7a10104 Mon Sep 17 00:00:00 2001 From: Jeffrey Stedfast Date: Fri, 5 Apr 2002 00:08:23 +0000 Subject: Simplified since we can now decode in-reply-to without getting extra 2002-04-04 Jeffrey Stedfast * camel-folder-summary.c (message_info_new): Simplified since we can now decode in-reply-to without getting extra cruft. Get rid of the FIXME about having to check scan->id because of the possibility of it being NULL, this can no longer happen. * camel-mime-utils.c (header_references_inreplyto_decode): New function to decode in-reply-to headers. Only grabs the first thing that looks like a message-id and then returns. (header_references_decode): Loop calling header_references_decode_single (a new internal function). svn path=/trunk/; revision=16361 --- camel/camel-folder-summary.c | 28 ++++------------------------ 1 file changed, 4 insertions(+), 24 deletions(-) (limited to 'camel/camel-folder-summary.c') diff --git a/camel/camel-folder-summary.c b/camel/camel-folder-summary.c index 6aa37010a6..6dd0cddc20 100644 --- a/camel/camel-folder-summary.c +++ b/camel/camel-folder-summary.c @@ -1588,26 +1588,9 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h) /* decode our references and in-reply-to headers */ refs = header_references_decode (header_raw_find (&h, "references", NULL)); - irt = header_references_decode (header_raw_find (&h, "in-reply-to", NULL)); + irt = header_references_inreplyto_decode (header_raw_find (&h, "in-reply-to", NULL)); if (refs || irt) { if (irt) { - struct _header_references *n, *r = irt; - - /* If there are multiple things in In-Reply-To that look like Message-IDs, - only use the first one of them: odds are that the later ones are actually - email addresses, not IDs. */ - - /* since header_references_decode() returns the list in reverse order, - free all but the last In-Reply-To message-id */ - while (r->next) { - n = r->next; - g_free (r->id); - g_free (r); - r = n; - } - - irt = r; - /* The References field is populated from the ``References'' and/or ``In-Reply-To'' headers. If both headers exist, take the first thing in the In-Reply-To header that looks like a Message-ID, and append it to the References header. */ @@ -1623,12 +1606,9 @@ message_info_new(CamelFolderSummary *s, struct _header_raw *h) count = 0; scan = refs; while (scan) { - /* FIXME: the id might be NULL because of a small bug in camel-mime-utils */ - if (scan->id) { - md5_get_digest(scan->id, strlen(scan->id), digest); - memcpy(mi->references->references[count].id.hash, digest, sizeof(mi->message_id.id.hash)); - count++; - } + md5_get_digest(scan->id, strlen(scan->id), digest); + memcpy(mi->references->references[count].id.hash, digest, sizeof(mi->message_id.id.hash)); + count++; scan = scan->next; } mi->references->size = count; -- cgit v1.2.3