im.pidgin.pidgin.next.minor: c9a0fddea31ad4905f44cfed7fb0da7d6ff6eff4

sadrul at pidgin.im sadrul at pidgin.im
Tue Oct 30 06:10:32 EDT 2007


-----------------------------------------------------------------
Revision: c9a0fddea31ad4905f44cfed7fb0da7d6ff6eff4
Ancestor: f0cdd16c20f9773e28cd79b36ffcf1c66057e32e
Author: sadrul at pidgin.im
Date: 2007-10-30T10:15:58
Branch: im.pidgin.pidgin.next.minor

Modified files:
        libpurple/util.c

ChangeLog: 

Close #2810. ('Non-XHTML-IM messages with links in them are broken.')

-------------- next part --------------
============================================================
--- libpurple/util.c	4f660df5ba1ac3513c825a20fbd1cf9bfee79be6
+++ libpurple/util.c	b8b11631075a711ec990179837469781448fbc54
@@ -1372,7 +1372,9 @@ purple_markup_html_to_xhtml(const char *
 							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);
@@ -1732,6 +1734,8 @@ purple_markup_html_to_xhtml(const char *
 				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)
@@ -1757,6 +1761,8 @@ purple_markup_html_to_xhtml(const char *
 		*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:


More information about the Commits mailing list