Mercurial > pidgin
changeset 19936:191fa8a8c0bc
Add compile-time option MSIM_MARKUP_SHOW_UNKNOWN_TAGS, enabled by default
(to encourage bug reports to be filed on unknown tags), and ignore the
<html> tag that Adium sends.
author | Jeffrey Connelly <jaconnel@calpoly.edu> |
---|---|
date | Mon, 17 Sep 2007 03:34:11 +0000 |
parents | 39d620a93907 |
children | 36ba89a2b7da 2a9f3a499b0d |
files | libpurple/protocols/myspace/markup.c libpurple/protocols/myspace/myspace.h |
diffstat | 2 files changed, 13 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/markup.c Tue Sep 11 23:50:37 2007 +0000 +++ b/libpurple/protocols/myspace/markup.c Mon Sep 17 03:34:11 2007 +0000 @@ -426,13 +426,14 @@ html_tag_to_msim_markup(MsimSession *session, xmlnode *root, gchar **begin, gchar **end) { + if (!purple_utf8_strcasecmp(root->name, "root") || + !purple_utf8_strcasecmp(root->name, "html")) { + *begin = g_strdup(""); + *end = g_strdup(""); /* TODO: Coalesce nested tags into one <f> tag! * Currently, the 's' value will be overwritten when b/i/u is nested * within another one, and only the inner-most formatting will be * applied to the text. */ - if (!purple_utf8_strcasecmp(root->name, "root")) { - *begin = g_strdup(""); - *end = g_strdup(""); } else if (!purple_utf8_strcasecmp(root->name, "b")) { *begin = g_strdup_printf("<f s='%d'>", MSIM_TEXT_BOLD); *end = g_strdup("</f>"); @@ -503,8 +504,14 @@ /* TODO: color (bg uses <body>), emoticons */ } else { + +#ifdef MSIM_MARKUP_SHOW_UNKNOWN_TAGS *begin = g_strdup_printf("[%s]", root->name); *end = g_strdup_printf("[/%s]", root->name); +#else + *begin = g_strdup(""); + *end = g_strdup(""); +#endif } }
--- a/libpurple/protocols/myspace/myspace.h Tue Sep 11 23:50:37 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Mon Sep 17 03:34:11 2007 +0000 @@ -67,6 +67,9 @@ /*#define MSIM_DEBUG_LOGIN_CHALLENGE*/ /*#define MSIM_DEBUG_RXBUF */ +/* Encode unknown HTML tags in messages in [], instead of ignoring */ +#define MSIM_MARKUP_SHOW_UNKNOWN_TAGS + /* Define to cause init_plugin() to run some tests and print * the results to the Purple debug log, then exit. Useful to * run with 'pidgin -d' to see the output. Don't define if