diff 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
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/libymsg.c	Thu Jul 08 22:23:43 2010 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Thu Jul 08 22:38:33 2010 +0000
@@ -3974,7 +3974,6 @@
 void yahoo_tooltip_text(PurpleBuddy *b, PurpleNotifyUserInfo *user_info, gboolean full)
 {
 	YahooFriend *f;
-	char *escaped;
 	char *status = NULL;
 	const char *presence = NULL;
 	PurpleAccount *account;
@@ -4013,14 +4012,12 @@
 	}
 
 	if (status != NULL) {
-		escaped = g_markup_escape_text(status, strlen(status));
-		purple_notify_user_info_add_pair(user_info, _("Status"), escaped);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Status"), status);
 		g_free(status);
-		g_free(escaped);
 	}
 
 	if (presence != NULL)
-		purple_notify_user_info_add_pair(user_info, _("Presence"), presence);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Presence"), presence);
 
 	if (f && full) {
 		YahooPersonalDetails *ypd = &f->ypd;