changeset 12158:d4725469b653

[gaim-migrate @ 14459] I assume it's ok to bring this into HEAD from oldstatus? : "Apparently at some point I wrote italic support for IRC and never committed it" -- Ethan, Aug 26th 2005. committer: Tailor Script <tailor@pidgin.im>
author Stu Tomlinson <stu@nosnilmot.com>
date Sat, 19 Nov 2005 14:07:19 +0000
parents b105009a60ae
children 721b3bbbaa6a
files src/protocols/irc/parse.c
diffstat 1 files changed, 13 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/irc/parse.c	Sat Nov 19 14:03:54 2005 +0000
+++ b/src/protocols/irc/parse.c	Sat Nov 19 14:07:19 2005 +0000
@@ -284,7 +284,7 @@
 	const char *cur, *end;
 	char fg[3] = "\0\0", bg[3] = "\0\0";
 	int fgnum, bgnum;
-	int font = 0, bold = 0, underline = 0;
+	int font = 0, bold = 0, underline = 0, italic = 0;
 	GString *decoded = g_string_sized_new(strlen(string));
 
 	cur = string;
@@ -338,6 +338,16 @@
 				decoded = g_string_append_c(decoded, '>');
 			}
 			break;
+		case '\011':
+			cur++;
+			if (!italic) {
+				decoded = g_string_append(decoded, "<I>");
+				italic = TRUE;
+			} else {
+				decoded = g_string_append(decoded, "</I>");
+				italic = FALSE;
+			}
+			break;
 		case '\037':
 			cur++;
 			if (!underline) {
@@ -358,6 +368,8 @@
 		case '\000':
 			if (bold)
 				decoded = g_string_append(decoded, "</B>");
+			if (italic)
+				decoded = g_string_append(decoded, "</I>");
 			if (underline)
 				decoded = g_string_append(decoded, "</U>");
 			if (font)