]> spindle.queued.net Git - midori/commitdiff
Prepend 'mailto' to email links in the About dialogue
authorDale Whittaker <dayul@users.sf.net>
Tue, 8 Sep 2009 21:58:58 +0000 (23:58 +0200)
committerChristian Dywan <christian@twotoasts.de>
Tue, 8 Sep 2009 22:33:34 +0000 (00:33 +0200)
Some email clients require this to open email links.

midori/midori-browser.c

index 50d257044f2e4f3f1c9109a2d6a963680a8f4de3..eb0cf7ee1d4f1fb69bd93a262b8d26e628467498 100644 (file)
@@ -3966,7 +3966,13 @@ _action_about_activate_email (GtkAboutDialog* about,
                               const gchar*    uri,
                               gpointer        user_data)
 {
-    sokoke_show_uri (NULL, uri, GDK_CURRENT_TIME, NULL);
+    /* Some email clients need the 'mailto' to function properly */
+    gchar* newuri = NULL;
+    if (!g_str_has_prefix (uri, "mailto:"))
+        newuri = g_strconcat ("mailto:", uri, NULL);
+
+    sokoke_show_uri (NULL, newuri ? newuri : uri, GDK_CURRENT_TIME, NULL);
+    g_free (newuri);
 }
 
 static void