Mercurial > pidgin.yaz
comparison libpurple/notify.c @ 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 | 584063555949 |
children | 7281d151e492 63fb41aa3dbe |
comparison
equal
deleted
inserted
replaced
31809:dffc3c494168 | 31810:0123c69ec0e5 |
---|---|
600 entry = purple_notify_user_info_entry_new(label, value); | 600 entry = purple_notify_user_info_entry_new(label, value); |
601 user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry); | 601 user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry); |
602 } | 602 } |
603 | 603 |
604 void | 604 void |
605 purple_notify_user_info_add_pair_plaintext(PurpleNotifyUserInfo *user_info, const char *label, const char *value) | |
606 { | |
607 gchar *escaped; | |
608 PurpleNotifyUserInfoEntry *entry; | |
609 | |
610 escaped = g_markup_escape_text(value, -1); | |
611 entry = purple_notify_user_info_entry_new(label, escaped); | |
612 g_free(escaped); | |
613 user_info->user_info_entries = g_list_append(user_info->user_info_entries, entry); | |
614 } | |
615 | |
616 void | |
605 purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value) | 617 purple_notify_user_info_prepend_pair(PurpleNotifyUserInfo *user_info, const char *label, const char *value) |
606 { | 618 { |
607 PurpleNotifyUserInfoEntry *entry; | 619 PurpleNotifyUserInfoEntry *entry; |
608 | 620 |
609 entry = purple_notify_user_info_entry_new(label, value); | 621 entry = purple_notify_user_info_entry_new(label, value); |