# HG changeset patch # User Evan Schoenberg # Date 1191015015 0 # Node ID 187fa336c1b003c6ddb04b556681759033e2b1e2 # Parent 5c42c7c7780d0458452bd3f9ea49d2de3a972093 Plucked mysapce tag parsing fixes applied changes from c5468fb873563f4e1249323a03f5531e192965f3 through 34d642b12b7215d55fd032cd513a7e225715f19a applied changes from 43e06ba1c67cc326d2d93f14d67709b2375da88b through bf8de57ed4c36f188044ea0684c201d0a1a67169 applied changes from 854642c5c0ea1bb31de3fd0dc5b0c480b70fc327 through 5a661e7759c94109af265616312c40858ae77e27 diff -r 5c42c7c7780d -r 187fa336c1b0 libpurple/protocols/myspace/markup.c --- a/libpurple/protocols/myspace/markup.c Fri Sep 28 20:58:27 2007 +0000 +++ b/libpurple/protocols/myspace/markup.c Fri Sep 28 21:30:15 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 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("", MSIM_TEXT_BOLD); *end = g_strdup(""); @@ -503,8 +504,20 @@ /* TODO: color (bg uses ), emoticons */ } else { + gchar *err; + +#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 + + err = g_strdup_printf("html_tag_to_msim_markup: unrecognized " + "HTML tag %s was sent by the IM client; ignoring", (root->name ? root->name : "(NULL)")); + msim_unrecognized(NULL, NULL, err); + g_free(err); } } diff -r 5c42c7c7780d -r 187fa336c1b0 libpurple/protocols/myspace/myspace.h --- a/libpurple/protocols/myspace/myspace.h Fri Sep 28 20:58:27 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.h Fri Sep 28 21:30:15 2007 +0000 @@ -67,6 +67,10 @@ /*#define MSIM_DEBUG_LOGIN_CHALLENGE*/ /*#define MSIM_DEBUG_RXBUF */ +/* Encode unknown HTML tags from IM clients in messages as [tag], instead of + * ignoring. Useful for debugging */ +/*#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