# HG changeset patch # User Mark Doliner # Date 1135882908 0 # Node ID 323af3853ed50beb5c230a13c85ec93451e195f5 # Parent 00e1a81307b2bfa8413761491dcb24a425859fcd [gaim-migrate @ 15018] fix sf bug #1252921, show iChat foreground and background color tags committer: Tailor Script diff -r 00e1a81307b2 -r 323af3853ed5 src/protocols/oscar/oscar.c --- a/src/protocols/oscar/oscar.c Thu Dec 29 17:44:08 2005 +0000 +++ b/src/protocols/oscar/oscar.c Thu Dec 29 19:01:48 2005 +0000 @@ -3907,6 +3907,9 @@ GString *message; gchar *tmp; aim_mpmsg_section_t *curpart; + const char *start; + const char *end; + GData *attribs; gaim_debug_misc("oscar", "Received IM from %s with %d parts\n", userinfo->sn, args->mpmsg.numparts); @@ -3972,7 +3975,7 @@ curpart = args->mpmsg.parts; while (curpart != NULL) { tmp = gaim_plugin_oscar_decode_im_part(account, userinfo->sn, curpart->charset, -- curpart->charsubset, curpart->data, curpart->datalen); + curpart->charsubset, curpart->data, curpart->datalen); if (tmp != NULL) { g_string_append(message, tmp); g_free(tmp); @@ -4001,6 +4004,34 @@ tmp = tmp2; } + /* + * Convert iChat color tags to normal font tags. + */ + if (gaim_markup_find_tag("body", tmp, &start, &end, &attribs)) + { + const char *ichattextcolor, *ichatballooncolor; + + ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor"); + if (ichattextcolor != NULL) + { + gchar *tmp2; + tmp2 = g_strdup_printf("%s", ichattextcolor, tmp); + g_free(tmp); + tmp = tmp2; + } + + ichatballooncolor = g_datalist_get_data(&attribs, "ichatballooncolor"); + if (ichatballooncolor != NULL) + { + gchar *tmp2; + tmp2 = g_strdup_printf("%s", ichatballooncolor, tmp); + g_free(tmp); + tmp = tmp2; + } + + g_datalist_clear(&attribs); + } + serv_got_im(gc, userinfo->sn, tmp, flags, time(NULL)); g_free(tmp);