changeset 21185:4a0f841e6f26

applied changes from f0cdd16c20f9773e28cd79b36ffcf1c66057e32e through c9a0fddea31ad4905f44cfed7fb0da7d6ff6eff4 References #2810
author Stu Tomlinson <stu@nosnilmot.com>
date Fri, 09 Nov 2007 17:37:12 +0000
parents 2b3267850744
children 7686eec5a6e3
files libpurple/util.c
diffstat 1 files changed, 7 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/util.c	Fri Nov 09 09:44:53 2007 +0000
+++ b/libpurple/util.c	Fri Nov 09 17:37:12 2007 +0000
@@ -1352,7 +1352,9 @@
 							g_string_append_printf(xhtml, "</%s>", pt->dest_tag);
 						if(plain && !strcmp(pt->src_tag, "a")) {
 							/* if this is a link, we have to add the url to the plaintext, too */
-							if (cdata && url && !g_string_equal(cdata, url))
+							if (cdata && url &&
+									(!g_string_equal(cdata, url) && (g_ascii_strncasecmp(url->str, "mailto:", 7) != 0 ||
+									                                 g_utf8_collate(url->str + 7, cdata->str) != 0)))
 								g_string_append_printf(plain, " <%s>", g_strstrip(url->str));
 							if (cdata) {
 								g_string_free(cdata, TRUE);
@@ -1712,6 +1714,8 @@
 				xhtml = g_string_append_len(xhtml, c, len);
 			if(plain)
 				plain = g_string_append(plain, pln);
+			if(cdata)
+				cdata = g_string_append_len(cdata, c, len);
 			c += len;
 		} else {
 			if(xhtml)
@@ -1737,6 +1741,8 @@
 		*plain_out = g_string_free(plain, FALSE);
 	if(url)
 		g_string_free(url, TRUE);
+	if (cdata)
+		g_string_free(cdata, TRUE);
 }
 
 /* The following are probably reasonable changes: