]> git.0d.be Git - empathy.git/commitdiff
Prepend "mailto:" to urls containing a "@".
authorXavier Claessens <xclaesse@src.gnome.org>
Fri, 4 Jul 2008 16:07:02 +0000 (16:07 +0000)
committerXavier Claessens <xclaesse@src.gnome.org>
Fri, 4 Jul 2008 16:07:02 +0000 (16:07 +0000)
svn path=/trunk/; revision=1196

libempathy-gtk/empathy-ui-utils.c

index 6b02b1a929a6241f813a303f482c65012d77e796..ae367514577ba81ea3a7dedaef76cba6b114c21c 100644 (file)
@@ -1294,13 +1294,17 @@ empathy_get_toplevel_window (GtkWidget *widget)
 static gchar *
 fixup_url (const gchar *url)
 {
-       if (!g_str_has_prefix (url, "ghelp:") &&
-           !strstr (url, ":/") &&
-           !strstr (url, "@")) {
-               return g_strdup_printf ("http://%s", url);
-       } else {
+       if (g_str_has_prefix (url, "ghelp:") ||
+           g_str_has_prefix (url, "mailto:") ||
+           strstr (url, ":/")) {
                return NULL;
        }
+
+       if (strstr (url, "@")) {
+               return g_strdup_printf ("mailto:%s", url);
+       }
+
+       return g_strdup_printf ("http://%s", url);
 }
 
 void