Mercurial > pidgin
diff libpurple/protocols/yahoo/yahoo_profile.c @ 31361:0123c69ec0e5
Add a purple_notify_user_info_add_pair_plaintext function that accepts a
plaintext value and escapes it. This is a convenience function. Previously
callers would have to escape the value themselves.
The motivation for this is that a lot of callers didn't escape the value
when they should have. See these screenshots for an example of the problem
this causes:
Here's what I set my jabber info to:
http://img29.imageshack.us/i/screenshotafter.png/
Here's what the old code displayed when I viewed info for myself (incorrect):
http://img691.imageshack.us/i/screenshotbeforev.png/
Here's what the new code displays (correct):
http://img192.imageshack.us/i/screenshotafter.png/
author | Mark Doliner <mark@kingant.net> |
---|---|
date | Thu, 08 Jul 2010 22:38:33 +0000 |
parents | 908be3822215 |
children | dc3ea8f6381a |
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/yahoo_profile.c Thu Jul 08 22:23:43 2010 +0000 +++ b/libpurple/protocols/yahoo/yahoo_profile.c Thu Jul 08 22:38:33 2010 +0000 @@ -701,14 +701,12 @@ if (b) { const char *balias = purple_buddy_get_local_buddy_alias(b); if(balias && balias[0]) { - char *aliastext = g_markup_escape_text(balias, -1); - purple_notify_user_info_add_pair(user_info, _("Alias"), aliastext); - g_free(aliastext); + purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias); } #if 0 if (b->idle > 0) { char *idletime = purple_str_seconds_to_string(time(NULL) - b->idle); - purple_notify_user_info_add_pair(user_info, _("Idle"), idletime); + purple_notify_user_info_add_pair_plaintext(user_info, _("Idle"), idletime); g_free(idletime); } #endif @@ -719,7 +717,7 @@ if ((f = yahoo_friend_find(info_data->gc, purple_buddy_get_name(b)))) { const char *ip; if ((ip = yahoo_friend_get_ip(f))) - purple_notify_user_info_add_pair(user_info, _("IP Address"), ip); + purple_notify_user_info_add_pair_plaintext(user_info, _("IP Address"), ip); } } }