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-folder-view.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-folder-view.c')
-rw-r--r-- | mail/em-folder-view.c | 16 |
1 files changed, 13 insertions, 3 deletions
diff --git a/mail/em-folder-view.c b/mail/em-folder-view.c index fd2801f904..66835a56a8 100644 --- a/mail/em-folder-view.c +++ b/mail/em-folder-view.c @@ -2121,9 +2121,19 @@ emfv_on_url_cb (GObject *emitter, const char *url, EMFolderView *emfv) char *nice_url = NULL; if (url) { - if (strncmp (url, "mailto:", 7) == 0) - nice_url = g_strdup_printf (_("Click to mail %s"), url + 7); - else + if (strncmp (url, "mailto:", 7) == 0) { + CamelInternetAddress *cia = camel_internet_address_new(); + CamelURL *curl; + char *addr; + + curl = camel_url_new(url, NULL); + camel_address_decode((CamelAddress *)cia, curl->path); + addr = camel_address_format((CamelAddress *)cia); + nice_url = g_strdup_printf (_("Click to mail %s"), addr&&addr[0]?addr:(url + 7)); + g_free(addr); + camel_url_free(curl); + camel_object_unref(cia); + } else nice_url = g_strdup_printf (_("Click to open %s"), url); } |