[evolution] I#1870 - Show mailto: hyperlinks in the status bar percent-decoded



commit d85b81f19bc3811c1e479412db6ac04561b5931b
Author: Milan Crha <mcrha redhat com>
Date:   Wed Apr 20 11:45:08 2022 +0200

    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 5530756770..07907b46b8 100644
--- a/src/e-util/e-misc-utils.c
+++ b/src/e-util/e-misc-utils.c
@@ -4697,11 +4697,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);
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]