From 7fc592861825abf6bf91a324d636ef433f8100b8 Mon Sep 17 00:00:00 2001 From: Not Zed Date: Tue, 13 Feb 2001 00:30:45 +0000 Subject: Add address headers to list that we dont fold when writing. The are 2001-02-12 Not Zed * camel-mime-part.c (init_header_name_table): Add address headers to list that we dont fold when writing. The are properly formatted as we build them. (write_to_stream): DOH, lookup the header name in the formatted hash table, not the value, that would never have worked. * camel-internet-address.c (camel_internet_address_encode_address): Changed to take a parameter saying how much we've printed so far. We now fold the header as we format it. We dont fold addresses, even if they are too long, we simply put them on another line by themselves: this should make the result more parsable by mailers that can't handle split up addresses (which are legal). (internet_encode): Fix for changes to above. svn path=/trunk/; revision=8198 --- camel/camel-mime-part.c | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) (limited to 'camel/camel-mime-part.c') diff --git a/camel/camel-mime-part.c b/camel/camel-mime-part.c index a22b96240a..8145bc1675 100644 --- a/camel/camel-mime-part.c +++ b/camel/camel-mime-part.c @@ -99,6 +99,10 @@ init_header_name_table() header_formatted_table = g_hash_table_new(g_strcase_hash, g_strcase_equal); g_hash_table_insert(header_formatted_table, "Content-Type", (void *)1); g_hash_table_insert(header_formatted_table, "Content-Disposition", (void *)1); + g_hash_table_insert(header_formatted_table, "To", (void *)1); + g_hash_table_insert(header_formatted_table, "From", (void *)1); + g_hash_table_insert(header_formatted_table, "Cc", (void *)1); + g_hash_table_insert(header_formatted_table, "Bcc", (void *)1); } static void @@ -493,7 +497,7 @@ write_to_stream(CamelDataWrapper *data_wrapper, CamelStream *stream) if (val == NULL) { g_warning("h->value is NULL here for %s", h->name); count = 0; - } else if (g_hash_table_lookup(header_formatted_table, val) == NULL) { + } else if (g_hash_table_lookup(header_formatted_table, h->name) == NULL) { val = header_fold(val, strlen(h->name)); count = camel_stream_printf(stream, "%s%s%s\n", h->name, isspace(val[0]) ? ":" : ": ", val); g_free(val); -- cgit v1.2.3