Mercurial > pidgin
comparison libpurple/notify.h @ 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 | d06f9250cf5a |
children | 63fb41aa3dbe |
comparison
equal
deleted
inserted
replaced
31360:dffc3c494168 | 31361:0123c69ec0e5 |
---|---|
538 * @param label A label, which for example might be displayed by a | 538 * @param label A label, which for example might be displayed by a |
539 * UI with a colon after it ("Status:"). Do not include | 539 * UI with a colon after it ("Status:"). Do not include |
540 * a colon. If NULL, value will be displayed without a | 540 * a colon. If NULL, value will be displayed without a |
541 * label. | 541 * label. |
542 * @param value The value, which might be displayed by a UI after | 542 * @param value The value, which might be displayed by a UI after |
543 * the label. If NULL, label will still be displayed; | 543 * the label. This should be valid HTML. If you want |
544 * the UI should then treat label as independent and not | 544 * to insert plaintext then use |
545 * purple_notify_user_info_add_pair_plaintext(), instead. | |
546 * If this is NULL the label will still be displayed; | |
547 * the UI should treat label as independent and not | |
545 * include a colon if it would otherwise. | 548 * include a colon if it would otherwise. |
546 */ | 549 */ |
550 /* | |
551 * TODO: In 3.0.0 this function should be renamed to | |
552 * purple_notify_user_info_add_pair_html(). And optionally | |
553 * purple_notify_user_info_add_pair_plaintext() could be renamed to | |
554 * purple_notify_user_info_add_pair(). | |
555 */ | |
547 void purple_notify_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value); | 556 void purple_notify_user_info_add_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value); |
557 | |
558 /** | |
559 * Like purple_notify_user_info_add_pair, but value should be plaintext | |
560 * and will be escaped using g_markup_escape_text(). | |
561 */ | |
562 void purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value); | |
548 | 563 |
549 /** | 564 /** |
550 * Prepend a label/value pair to a PurpleNotifyUserInfo object | 565 * Prepend a label/value pair to a PurpleNotifyUserInfo object |
551 * | 566 * |
552 * @param user_info The PurpleNotifyUserInfo | 567 * @param user_info The PurpleNotifyUserInfo |