diff options
author | Not Zed <NotZed@Ximian.com> | 2004-01-19 09:15:25 +0800 |
---|---|---|
committer | Michael Zucci <zucchi@src.gnome.org> | 2004-01-19 09:15:25 +0800 |
commit | 4a011b9d49d23d3f26a9d054b5c9a5412a61b254 (patch) | |
tree | 5bdc32b44480c23b91d54d32c6c18882abf4c9fa /mail/em-format-html.c | |
parent | b2daabc151be6b918dcb89ba7d0b64e293e39df1 (diff) | |
download | gsoc2013-evolution-4a011b9d49d23d3f26a9d054b5c9a5412a61b254.tar.gz gsoc2013-evolution-4a011b9d49d23d3f26a9d054b5c9a5412a61b254.tar.zst gsoc2013-evolution-4a011b9d49d23d3f26a9d054b5c9a5412a61b254.zip |
properly decode the mailto url rather than treating it as a simple string.
2004-01-19 Not Zed <NotZed@Ximian.com>
* em-folder-view.c (emfv_on_url_cb): properly decode the mailto
url rather than treating it as a simple string.
* em-format-html.c (efh_format_address): if we have a name part,
add it to the mailto part. As per rfc2368. So it isn't lost for
clicking/etc.
svn path=/trunk/; revision=24298
Diffstat (limited to 'mail/em-format-html.c')
-rw-r--r-- | mail/em-format-html.c | 15 |
1 files changed, 12 insertions, 3 deletions
diff --git a/mail/em-format-html.c b/mail/em-format-html.c index edd7c25730..a0346b00b0 100644 --- a/mail/em-format-html.c +++ b/mail/em-format-html.c @@ -1467,10 +1467,19 @@ efh_format_address (GString *out, struct _camel_header_address *a) switch (a->type) { case CAMEL_HEADER_ADDRESS_NAME: - if (name && *name) + if (name && *name) { + char *real, *mailaddr; + g_string_append_printf (out, "%s <", name); - - mailto = camel_url_encode (a->v.addr, ""); + /* rfc2368 for mailto syntax and url encoding extras */ + real = camel_header_encode_phrase(a->name); + mailaddr = g_strdup_printf("%s <%s>", real, a->v.addr); + g_free(real); + mailto = camel_url_encode(mailaddr, "?=&()"); + g_free(mailaddr); + } else { + mailto = camel_url_encode (a->v.addr, "?=&()"); + } addr = camel_text_to_html (a->v.addr, flags, 0); g_string_append_printf (out, "<a href=\"mailto:%s\">%s</a>", mailto, addr); g_free (mailto); |