Mercurial > pidgin.yaz
changeset 19599:0a170af12723
merge of '0dbc6114de523821fc87cf7d1c44b30aa0e92713'
and 'a1d362572ca941722a9db19c6886f7796b6d8d81'
author | Sadrul Habib Chowdhury <imadil@gmail.com> |
---|---|
date | Mon, 03 Sep 2007 06:51:15 +0000 |
parents | dd4b1dc8a0ce (diff) c3259b161070 (current diff) |
children | 8b887be774e2 |
files | |
diffstat | 2 files changed, 16 insertions(+), 3 deletions(-) [+] |
line wrap: on
line diff
--- a/libpurple/protocols/myspace/markup.c Mon Sep 03 06:49:13 2007 +0000 +++ b/libpurple/protocols/myspace/markup.c Mon Sep 03 06:51:15 2007 +0000 @@ -669,6 +669,8 @@ /** High-level function to convert Purple (HTML) to MySpaceIM markup. * + * TODO: consider using purple_markup_html_to_xhtml() to make valid XML. + * * @return HTML markup string, must be g_free()'d. */ gchar * html_to_msim_markup(MsimSession *session, const gchar *raw)
--- a/libpurple/protocols/myspace/myspace.c Mon Sep 03 06:49:13 2007 +0000 +++ b/libpurple/protocols/myspace/myspace.c Mon Sep 03 06:51:15 2007 +0000 @@ -1066,9 +1066,12 @@ statstring = purple_status_get_attr_string(status, "message"); if (!statstring) { - statstring = g_strdup(""); + statstring = ""; } + /* Status strings are plain text. */ + statstring = purple_markup_strip_html(statstring); + msim_set_status_code(session, status_code, g_strdup(statstring)); } @@ -1713,7 +1716,7 @@ PurpleBuddyList *blist; MsimUser *user; GList *list; - gchar *status_headline; + gchar *status_headline, *status_headline_escaped; gint status_code, purple_status_code; gchar *username; @@ -1768,8 +1771,16 @@ purple_debug_info("msim", "msim_status: found buddy %s\n", username); } + /* The status headline is plaintext, but libpurple treats it as HTML, + * so escape any HTML characters to their entity equivalents. */ + status_headline_escaped = g_markup_escape_text(status_headline, strlen(status_headline)); + g_free(status_headline); + + if (user->headline) + g_free(user->headline); + /* don't copy; let the MsimUser own the headline, memory-wise */ - user->headline = status_headline; + user->headline = status_headline_escaped; /* Set user status */ switch (status_code) {