From f5f53f52730d5f7c92fb0f8a8d084ea027a1122d Mon Sep 17 00:00:00 2001 From: Milan Crha Date: Wed, 20 Apr 2022 11:45:08 +0200 Subject: [PATCH] I#1870 - Show mailto: hyperlinks in the status bar percent-decoded Closes https://gitlab.gnome.org/GNOME/evolution/-/issues/1870 --- src/e-util/e-misc-utils.c | 20 +++++++++++++++++++- 1 file changed, 19 insertions(+), 1 deletion(-) diff --git a/src/e-util/e-misc-utils.c b/src/e-util/e-misc-utils.c index f5b7d76758..c7f7fe0b71 100644 --- a/src/e-util/e-misc-utils.c +++ b/src/e-util/e-misc-utils.c @@ -4670,11 +4670,29 @@ e_util_get_uri_tooltip (const gchar *uri) camel_address_decode (CAMEL_ADDRESS (address), curl->path); camel_internet_address_sanitize_ascii_domain (address); who = camel_address_format (CAMEL_ADDRESS (address)); + + if (!who && g_str_has_prefix (uri, "mailto:") && curl->query && *curl->query) { + GHashTable *query; + + query = soup_form_decode (curl->query); + if (query) { + const gchar *to = g_hash_table_lookup (query, "to"); + if (to && *to) { + camel_address_decode (CAMEL_ADDRESS (address), to); + camel_internet_address_sanitize_ascii_domain (address); + who = camel_address_format (CAMEL_ADDRESS (address)); + } + g_hash_table_destroy (query); + } + } + g_object_unref (address); camel_url_free (curl); - if (!who) + if (!who) { who = g_strdup (strchr (uri, ':') + 1); + camel_url_decode (who); + } message = g_string_new (NULL);