aboutsummaryrefslogtreecommitdiffstats
path: root/libempathy-gtk
diff options
context:
space:
mode:
authorXavier Claessens <xclaesse@src.gnome.org>2008-07-05 00:07:02 +0800
committerXavier Claessens <xclaesse@src.gnome.org>2008-07-05 00:07:02 +0800
commit3d2d694feab078b7926bb3142a138338fa340869 (patch)
tree8000800d6f657ee32146c5cc9bce8693608ed840 /libempathy-gtk
parent4a2964952e69d74c3846b0bb7429a2c9b11469ef (diff)
downloadgsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar.gz
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar.bz2
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar.lz
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar.xz
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.tar.zst
gsoc2013-empathy-3d2d694feab078b7926bb3142a138338fa340869.zip
Prepend "mailto:" to urls containing a "@".
svn path=/trunk/; revision=1196
Diffstat (limited to 'libempathy-gtk')
-rw-r--r--libempathy-gtk/empathy-ui-utils.c14
1 files changed, 9 insertions, 5 deletions
diff --git a/libempathy-gtk/empathy-ui-utils.c b/libempathy-gtk/empathy-ui-utils.c
index 6b02b1a92..ae3675145 100644
--- a/libempathy-gtk/empathy-ui-utils.c
+++ b/libempathy-gtk/empathy-ui-utils.c
@@ -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