From: Alagunambi W. <ala...@gm...> - 2009-10-29 19:49:51
|
Hi, This is my first patch :-) Patch for adding colour to the message body. Correct me if I am wrong, Ill be happy to learn. <patch> From: Alagunambi Welkin <ala...@gm...> Date: Thu, 29 Oct 01:15:24 IST 2009 Patch for ay_msn_format_message() to add colour to the body. Index: trunk/modules/msn2/msn.c ------------------------------------------------------------------------ --- ayttm/modules/msn2/msn.c 2009-10-28 13:34:10.000000000 -0400 +++ work/modules/msn2/msn.c 2009-10-29 19:02:04.000000000 -0400 @@ -2110,8 +2110,49 @@ static void ay_msn_format_message(MsnIM retval = g_strdup_printf("<b>%s</b>", msg->body); if (msg->underline) retval = g_strdup_printf("<u>%s</u>", msg->body); + + switch (msg->color) { + case black: + retval = g_strdup_printf("<font color=#000000>"%s"</font>", + msg->body); + break; + case blue: + retval = g_strdup_printf("<font color=#000080>"%s"</font>", + msg->body); + break; + case lblue: + retval = g_strdup_printf("<font color=#0000c0>"%s"</font>", + msg->body); + break; + case gray: + retval = g_strdup_printf("<font color=#808080>"%s"</font>", + msg->body); + break; + case green: + retval = g_strdup_printf("<font color=#008000>"%s"</font>", + msg->body); + break; + case pink: + retval = g_strdup_printf("<font color=#c000c0>"%s"</font>", + msg->body); + break; + case purple: + retval = g_strdup_printf("<font color=#800080>"%s"</font>", + msg->body); + break; + case orange: + retval = g_strdup_printf("<font color=#f95002>"%s"</font>", + msg->body); + break; + case red: + retval = g_strdup_printf("<font color=#800000>"%s"</font>", + msg->body); + break; + case olive: + retval = g_strdup_printf("<font color=#00c000>"%s"</font>", + msg->body); + break; /* todo: other formatting fields - * CO: color - color IS in HTML colour format (RGB hex) * CS: ? (haven't the faintest - Meredydd) * PF: ? (ditto) */ </patch> Thanks ;-) Alagunambi Welkin |