# HG changeset patch
# User Paul Aurich
# Date 1259459436 0
# Node ID ce29013a5f3a847f1d250c64b9aa2508a2e62c49
# Parent 23f6f80f45ed1fc653ff8faf087e21f5dc26c389
oscar: Fix the parsing code from ichatballooncolors that broke receiving markup in 2.6.2.
This also fixes the horrendous AIM Blast markup syntax. Closes #10234.
diff -r 23f6f80f45ed -r ce29013a5f3a ChangeLog
--- a/ChangeLog Sat Nov 28 23:13:55 2009 +0000
+++ b/ChangeLog Sun Nov 29 01:50:36 2009 +0000
@@ -20,6 +20,7 @@
* The simultaneous login account option is respected when using
the clientLogin authentication method.
* Fix offline message retrieval (broken in 2.6.3)
+ * Fix handling of markup on some messages (broken in 2.6.2)
* Fix SSL when clientLogin is enabled.
* Fix sending and receiving Unicode characters in a Direct IM
diff -r 23f6f80f45ed -r ce29013a5f3a libpurple/protocols/oscar/oscar.c
--- a/libpurple/protocols/oscar/oscar.c Sat Nov 28 23:13:55 2009 +0000
+++ b/libpurple/protocols/oscar/oscar.c Sun Nov 29 01:50:36 2009 +0000
@@ -2461,42 +2461,81 @@
*/
if (purple_markup_find_tag("body", tmp, &start, &end, &attribs))
{
+ int len;
+ char *tmp2, *body;
const char *ichattextcolor, *ichatballooncolor;
- const char *start2, *end2;
+ const char *slash_body_start, *slash_body_end = NULL; /*
but not !\n");
+ /* Take everything after */
+ body = g_strdup(start);
+ }
ichattextcolor = g_datalist_get_data(&attribs, "ichattextcolor");
if (ichattextcolor != NULL)
{
- gchar *tmp2;
- tmp2 = g_strdup_printf("%s", ichattextcolor, tmp);
- g_free(tmp);
- tmp = tmp2;
+ tmp2 = g_strdup_printf("%s", ichattextcolor, body);
+ g_free(body);
+ body = 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;
+ tmp2 = g_strdup_printf("%s", ichatballooncolor, body);
+ g_free(body);
+ body = tmp2;
}
g_datalist_clear(&attribs);
+
+ len = start - tmp;
+ tmp2 = g_strdup_printf("%.*s%s%s", len, tmp, body, slash_body_end ? slash_body_end + 1: "");
+ g_free(tmp);
+ g_free(body);
+
+ tmp = tmp2;
+ }
+
+ /*
+ * Are there