Mercurial > pidgin.yaz
diff libpurple/notify.h @ 31810: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 | d06f9250cf5a |
children | 63fb41aa3dbe |
line wrap: on
line diff
--- a/libpurple/notify.h Thu Jul 08 22:23:43 2010 +0000 +++ b/libpurple/notify.h Thu Jul 08 22:38:33 2010 +0000 @@ -540,13 +540,28 @@ * a colon. If NULL, value will be displayed without a * label. * @param value The value, which might be displayed by a UI after - * the label. If NULL, label will still be displayed; - * the UI should then treat label as independent and not + * the label. This should be valid HTML. If you want + * to insert plaintext then use + * purple_notify_user_info_add_pair_plaintext(), instead. + * If this is NULL the label will still be displayed; + * the UI should treat label as independent and not * include a colon if it would otherwise. */ +/* + * TODO: In 3.0.0 this function should be renamed to + * purple_notify_user_info_add_pair_html(). And optionally + * purple_notify_user_info_add_pair_plaintext() could be renamed to + * purple_notify_user_info_add_pair(). + */ void purple_notify_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value); /** + * Like purple_notify_user_info_add_pair, but value should be plaintext + * and will be escaped using g_markup_escape_text(). + */ +void purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value); + +/** * Prepend a label/value pair to a PurpleNotifyUserInfo object * * @param user_info The PurpleNotifyUserInfo