comparison libpurple/protocols/yahoo/libymsg.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 3ae0814ae727
children 41f1e44ad4b5
comparison
equal deleted inserted replaced
31809:dffc3c494168 31810:0123c69ec0e5
3972 } 3972 }
3973 3973
3974 void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full) 3974 void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full)
3975 { 3975 {
3976 YahooFriend *f; 3976 YahooFriend *f;
3977 char *escaped;
3978 char *status = NULL; 3977 char *status = NULL;
3979 const char *presence = NULL; 3978 const char *presence = NULL;
3980 PurpleAccount *account; 3979 PurpleAccount *account;
3981 3980
3982 account = purple_buddy_get_account(b); 3981 account = purple_buddy_get_account(b);
4011 break; 4010 break;
4012 } 4011 }
4013 } 4012 }
4014 4013
4015 if (status != NULL) { 4014 if (status != NULL) {
4016 escaped = g_markup_escape_text(status, strlen(status)); 4015 purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), status);
4017 purple_notify_user_info_add_pair(user_info, _("Status"), escaped);
4018 g_free(status); 4016 g_free(status);
4019 g_free(escaped);
4020 } 4017 }
4021 4018
4022 if (presence != NULL) 4019 if (presence != NULL)
4023 purple_notify_user_info_add_pair(user_info, _("Presence"), presence); 4020 purple_notify_user_info_add_pair_plaintext(user_info, _("Presence"), presence);
4024 4021
4025 if (f && full) { 4022 if (f && full) {
4026 YahooPersonalDetails *ypd = &f->ypd; 4023 YahooPersonalDetails *ypd = &f->ypd;
4027 int i; 4024 int i;
4028 struct { 4025 struct {