changeset 15790:d94d3d0f1149

merge of '1e5814c18dbd7349240ceeec8f3d25583e42a7bd' and '8fd51b26e00adf83c2b8a53c556b308efa1c6c51'
author Evan Schoenberg <evan.s@dreskin.net>
date Tue, 13 Mar 2007 10:28:03 +0000
parents b25acae693cd (current diff) 8cf610a18481 (diff)
children 465a58f2c711
files
diffstat 1 files changed, 25 insertions(+), 4 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/msn/msn-utils.c	Tue Mar 13 07:33:08 2007 +0000
+++ b/libpurple/protocols/msn/msn-utils.c	Tue Mar 13 10:28:03 2007 +0000
@@ -174,6 +174,11 @@
 	char fonteffect[4];
 	char fontcolor[7];
 
+	gboolean has_bold = FALSE;
+	gboolean has_italic = FALSE;
+	gboolean has_underline = FALSE;
+	gboolean has_strikethrough = FALSE;
+
 	g_return_if_fail(html       != NULL);
 	g_return_if_fail(attributes != NULL);
 	g_return_if_fail(message    != NULL);
@@ -197,22 +202,38 @@
 			}
 			else if (!g_ascii_strncasecmp(c + 1, "i>", 2))
 			{
-				strcat(fonteffect, "I");
+				if (!has_italic)
+				{
+					strcat(fonteffect, "I");
+					has_italic = TRUE;
+				}
 				c += 3;
 			}
 			else if (!g_ascii_strncasecmp(c + 1, "b>", 2))
 			{
-				strcat(fonteffect, "B");
+				if (!has_bold)
+				{
+					strcat(fonteffect, "B");
+					has_bold = TRUE;
+				}
 				c += 3;
 			}
 			else if (!g_ascii_strncasecmp(c + 1, "u>", 2))
 			{
-				strcat(fonteffect, "U");
+				if (!has_underline)
+				{
+					strcat(fonteffect, "U");
+					has_underline = TRUE;
+				}
 				c += 3;
 			}
 			else if (!g_ascii_strncasecmp(c + 1, "s>", 2))
 			{
-				strcat(fonteffect, "S");
+				if (!has_strikethrough)
+				{
+					strcat(fonteffect, "S");
+					has_strikethrough = TRUE;
+				}
 				c += 3;
 			}
 			else if (!g_ascii_strncasecmp(c + 1, "a href=\"", 8))