changeset 32359:dc3ea8f6381a

Use purple_notify_user_info_add_pair_plaintext in some places where we were using purple_notify_user_info_add_pair (which expects an html string for the value). Feel free to double check these if you care about one of these protocols.
author Mark Doliner <mark@kingant.net>
date Sun, 21 Aug 2011 18:43:00 +0000
parents ce6ef84fb8a0
children 9aee8493db7f 57d43a9a4e7e
files libpurple/protocols/irc/msgs.c libpurple/protocols/jabber/jabber.c libpurple/protocols/myspace/user.c libpurple/protocols/sametime/sametime.c libpurple/protocols/yahoo/libymsg.c libpurple/protocols/yahoo/yahoo_profile.c
diffstat 6 files changed, 25 insertions(+), 31 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/irc/msgs.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/irc/msgs.c	Sun Aug 21 18:43:00 2011 +0000
@@ -357,39 +357,35 @@
 	g_free(tmp);
 
 	if (irc->whois.away) {
-		tmp = g_markup_escape_text(irc->whois.away, strlen(irc->whois.away));
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Away"), irc->whois.away);
 		g_free(irc->whois.away);
-		purple_notify_user_info_add_pair(user_info, _("Away"), tmp);
-		g_free(tmp);
 	}
 	if (irc->whois.userhost) {
-		tmp = g_markup_escape_text(irc->whois.name, strlen(irc->whois.name));
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Username"), irc->whois.userhost);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Real name"), irc->whois.name);
+		g_free(irc->whois.userhost);
 		g_free(irc->whois.name);
-		purple_notify_user_info_add_pair(user_info, _("Username"), irc->whois.userhost);
-		purple_notify_user_info_add_pair(user_info, _("Real name"), tmp);
-		g_free(irc->whois.userhost);
-		g_free(tmp);
 	}
 	if (irc->whois.server) {
 		tmp = g_strdup_printf("%s (%s)", irc->whois.server, irc->whois.serverinfo);
-		purple_notify_user_info_add_pair(user_info, _("Server"), tmp);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Server"), tmp);
 		g_free(tmp);
 		g_free(irc->whois.server);
 		g_free(irc->whois.serverinfo);
 	}
 	if (irc->whois.channels) {
-		purple_notify_user_info_add_pair(user_info, _("Currently on"), irc->whois.channels->str);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Currently on"), irc->whois.channels->str);
 		g_string_free(irc->whois.channels, TRUE);
 	}
 	if (irc->whois.idle) {
 		gchar *timex = purple_str_seconds_to_string(irc->whois.idle);
-		purple_notify_user_info_add_pair(user_info, _("Idle for"), timex);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Idle for"), timex);
 		g_free(timex);
-		purple_notify_user_info_add_pair(user_info,
+		purple_notify_user_info_add_pair_plaintext(user_info,
 														_("Online since"), purple_date_format_full(localtime(&irc->whois.signon)));
 	}
-	if (!strcmp(irc->whois.nick, "Paco-Paco")) {
-		purple_notify_user_info_add_pair(user_info,
+	if (!strcmp(irc->whois.nick, "elb")) {
+		purple_notify_user_info_add_pair_plaintext(user_info,
 																   _("<b>Defining adjective:</b>"), _("Glorious"));
 	}
 
--- a/libpurple/protocols/jabber/jabber.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sun Aug 21 18:43:00 2011 +0000
@@ -2238,7 +2238,7 @@
 		gchar *idle_str =
 			purple_str_seconds_to_string(time(NULL) - jbr->idle);
 		label = g_strdup_printf("%s%s", _("Idle"), (res ? res : ""));
-		purple_notify_user_info_add_pair(user_info, label, idle_str);
+		purple_notify_user_info_add_pair_plaintext(user_info, label, idle_str);
 		g_free(idle_str);
 		g_free(label);
 	}
--- a/libpurple/protocols/myspace/user.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/myspace/user.c	Sun Aug 21 18:43:00 2011 +0000
@@ -117,27 +117,27 @@
 	/* Useful to identify the account the tooltip refers to.
 	 *  Other prpls show this. */
 	if (user->username) {
-		purple_notify_user_info_add_pair(user_info, _("User"), user->username);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("User"), user->username);
 	}
 
 	/* a/s/l...the vitals */
 	if (user->age) {
 		char age[16];
 		g_snprintf(age, sizeof(age), "%d", user->age);
-		purple_notify_user_info_add_pair(user_info, _("Age"), age);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Age"), age);
 	}
 
 	if (user->gender && *user->gender) {
-		purple_notify_user_info_add_pair(user_info, _("Gender"), user->gender);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Gender"), user->gender);
 	}
 
 	if (user->location && *user->location) {
-		purple_notify_user_info_add_pair(user_info, _("Location"), user->location);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Location"), user->location);
 	}
 
 	/* Other information */
 	if (user->headline && *user->headline) {
-		purple_notify_user_info_add_pair(user_info, _("Headline"), user->headline);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Headline"), user->headline);
 	}
 
 	if (user->buddy != NULL) {
@@ -153,7 +153,7 @@
 
 			str = msim_format_now_playing(artist, title);
 			if (str && *str) {
-				purple_notify_user_info_add_pair(user_info, _("Song"), str);
+				purple_notify_user_info_add_pair_plaintext(user_info, _("Song"), str);
 			}
 			g_free(str);
 		}
@@ -163,7 +163,7 @@
 	if (user->total_friends) {
 		char friends[16];
 		g_snprintf(friends, sizeof(friends), "%d", user->total_friends);
-		purple_notify_user_info_add_pair(user_info, _("Total Friends"), friends);
+		purple_notify_user_info_add_pair_plaintext(user_info, _("Total Friends"), friends);
 	}
 
 	if (full) {
@@ -181,7 +181,7 @@
 			client = g_strdup_printf("Build %d", cv);
 		}
 		if (client && *client)
-			purple_notify_user_info_add_pair(user_info, _("Client Version"), client);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Client Version"), client);
 		g_free(client);
 	}
 
--- a/libpurple/protocols/sametime/sametime.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/sametime/sametime.c	Sun Aug 21 18:43:00 2011 +0000
@@ -3334,9 +3334,7 @@
   status = status_text(b);
 
   if(message != NULL && g_utf8_validate(message, -1, NULL) && purple_utf8_strcasecmp(status, message)) {
-    tmp = g_markup_escape_text(message, -1);
-	purple_notify_user_info_add_pair(user_info, status, tmp);
-    g_free(tmp);
+	purple_notify_user_info_add_pair_plaintext(user_info, status, message);
 
   } else {
 	purple_notify_user_info_add_pair(user_info, _("Status"), status);
@@ -3350,7 +3348,7 @@
     }
 
     if(buddy_is_external(b)) {
-	  purple_notify_user_info_add_pair(user_info, NULL, _("External User"));
+	  purple_notify_user_info_add_pair_plaintext(user_info, NULL, _("External User"));
     }
   }
 }
--- a/libpurple/protocols/yahoo/libymsg.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Sun Aug 21 18:43:00 2011 +0000
@@ -4037,11 +4037,11 @@
 	if (f && full) {
 		YahooPersonalDetails *ypd = &f->ypd;
 		if (ypd->phone.home && *ypd->phone.home)
-			purple_notify_user_info_add_pair(user_info, _("Home Phone Number"), ypd->phone.home);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Home Phone Number"), ypd->phone.home);
 		if (ypd->phone.work && *ypd->phone.work)
-			purple_notify_user_info_add_pair(user_info, _("Work Phone Number"), ypd->phone.work);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Work Phone Number"), ypd->phone.work);
 		if (ypd->phone.mobile && *ypd->phone.mobile)
-			purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), ypd->phone.mobile);
+			purple_notify_user_info_add_pair_plaintext(user_info, _("Mobile Phone Number"), ypd->phone.mobile);
 	}
 }
 
--- a/libpurple/protocols/yahoo/yahoo_profile.c	Sun Aug 21 18:04:00 2011 +0000
+++ b/libpurple/protocols/yahoo/yahoo_profile.c	Sun Aug 21 18:43:00 2011 +0000
@@ -1228,7 +1228,7 @@
 			str = _("The user's profile is empty.");
 		}
 
-		purple_notify_user_info_add_pair(user_info, NULL, str);
+		purple_notify_user_info_add_pair_plaintext(user_info, NULL, str);
 	}
 
 	/* put a link to the actual profile URL */