[empathy] Use empathy_make_absolute_url to fix URLs that have no scheme



commit 8b9afe55dba0cb3dc7c20d714574e8c85f9fdb11
Author: Pierre-Luc Beaudoin <pierre-luc beaudoin collabora co uk>
Date:   Tue Aug 18 13:00:57 2009 -0400

    Use empathy_make_absolute_url to fix URLs that have no scheme

 libempathy-gtk/empathy-theme-adium.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)
---
diff --git a/libempathy-gtk/empathy-theme-adium.c b/libempathy-gtk/empathy-theme-adium.c
index c5fec06..b286464 100644
--- a/libempathy-gtk/empathy-theme-adium.c
+++ b/libempathy-gtk/empathy-theme-adium.c
@@ -308,6 +308,8 @@ theme_adium_parse_body (EmpathyThemeAdium *theme,
 
 		string = g_string_sized_new (strlen (text));
 		do {
+			gchar *real_url;
+
 			g_match_info_fetch_pos (match_info, 0, &s, &e);
 
 			if (s > last) {
@@ -317,12 +319,15 @@ theme_adium_parse_body (EmpathyThemeAdium *theme,
 			}
 
 			/* Append the link inside <a href=""></a> tag */
+			real_url = empathy_make_absolute_url (text + s);
+
 			g_string_append (string, "<a href=\"");
-			g_string_append_len (string, text + s, e - s);
+			g_string_append (string, real_url);
 			g_string_append (string, "\">");
 			g_string_append_len (string, text + s, e - s);
 			g_string_append (string, "</a>");
 
+			g_free (real_url);
 			last = e;
 		} while (g_match_info_next (match_info, NULL));
 



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