aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorNotZed <NotZed@HelixCode.com>2000-05-08 14:17:33 +0800
committerMichael Zucci <zucchi@src.gnome.org>2000-05-08 14:17:33 +0800
commitf168e3972c9c24648d26a3c97fb6ba317877afe4 (patch)
tree17aa51841518b9efa636556969c83475e44a5a74
parentb00a9126e56598e7941274f12c1acd6d2d9f9667 (diff)
downloadgsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar.gz
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar.bz2
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar.lz
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar.xz
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.tar.zst
gsoc2013-evolution-f168e3972c9c24648d26a3c97fb6ba317877afe4.zip
Format From and Reply-To to at least a decoded string. Should probably
2000-05-08 NotZed <NotZed@HelixCode.com> * camel-mime-message.c (process_header): Format From and Reply-To to at least a decoded string. Should probably store them as an camelinternetaddress. svn path=/trunk/; revision=2908
-rw-r--r--camel/ChangeLog4
-rw-r--r--camel/camel-mime-message.c24
2 files changed, 24 insertions, 4 deletions
diff --git a/camel/ChangeLog b/camel/ChangeLog
index afe10fe07c..cfb0984c30 100644
--- a/camel/ChangeLog
+++ b/camel/ChangeLog
@@ -1,5 +1,9 @@
2000-05-08 NotZed <NotZed@HelixCode.com>
+ * camel-mime-message.c (process_header): Format From and Reply-To
+ to at least a decoded string. Should probably store them as an
+ camelinternetaddress.
+
* Merged NEW_SUMMARY branch back to trunk, and resolved conflicts.
* providers/mbox/camel-mbox-summary.c (camel_mbox_summary_update):
diff --git a/camel/camel-mime-message.c b/camel/camel-mime-message.c
index d6fdc2c0a6..aa6cbeee4c 100644
--- a/camel/camel-mime-message.c
+++ b/camel/camel-mime-message.c
@@ -561,6 +561,22 @@ write_to_stream (CamelDataWrapper *data_wrapper, CamelStream *stream)
return CAMEL_DATA_WRAPPER_CLASS (parent_class)->write_to_stream (data_wrapper, stream);
}
+static char *
+format_address(const char *text)
+{
+ struct _header_address *addr;
+ char *ret;
+
+ addr = header_address_decode(text);
+ if (addr) {
+ ret = header_address_list_format(addr);
+ header_address_list_clear(&addr);
+ } else {
+ ret = g_strdup(text);
+ }
+ return ret;
+}
+
/* FIXME: check format of fields. */
static gboolean
process_header(CamelMedium *medium, const char *header_name, const char *header_value)
@@ -572,12 +588,12 @@ process_header(CamelMedium *medium, const char *header_name, const char *header_
header_type = (CamelHeaderType) g_hash_table_lookup (header_name_table, header_name);
switch (header_type) {
case HEADER_FROM:
- g_free(message->from); /* FIXME: parse the from line into something useful */
- message->from = g_strdup(header_value);
+ g_free(message->from);
+ message->from = format_address(header_value);
break;
case HEADER_REPLY_TO:
- g_free(message->reply_to); /* FIXME: parse the from line into something useful */
- message->reply_to = g_strdup(header_value);
+ g_free(message->reply_to);
+ message->reply_to = format_address(header_value);
break;
case HEADER_SUBJECT:
g_free(message->subject);