diff libpurple/protocols/zephyr/zephyr.c @ 32363:3322201b446f

I went through all our calls to purple_notify_user_info_add_pair() and checked whether they should be purple_notify_user_info_add_pair_plaintext(), instead. If it wasn't immediately obvious one way or the other then I left a comment to investigate. I suspect there are still a lot of places where we should use the _plaintext function to escape the value.
author Mark Doliner <mark@kingant.net>
date Mon, 22 Aug 2011 01:53:37 +0000
parents a5b556ac1de5
children 323876c34a96
line wrap: on
line diff
--- a/libpurple/protocols/zephyr/zephyr.c	Sun Aug 21 21:27:17 2011 +0000
+++ b/libpurple/protocols/zephyr/zephyr.c	Mon Aug 22 01:53:37 2011 +0000
@@ -791,18 +791,21 @@
 				char *tmp;
 				const char *balias;
 
+				/* TODO: Check whether it's correct to call add_pair_html,
+				         or if we should be using add_pair_plaintext */
 				purple_notify_user_info_add_pair(user_info, _("User"), (b ? bname : user));
 				balias = purple_buddy_get_local_buddy_alias(b);
 				if (b && balias)
-					purple_notify_user_info_add_pair(user_info, _("Alias"), balias);
+					purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias);
 
 				if (!nlocs) {
-					purple_notify_user_info_add_pair(user_info, NULL, _("Hidden or not logged-in"));
+					purple_notify_user_info_add_pair_plaintext(user_info, NULL, _("Hidden or not logged-in"));
 				}
 				for (; nlocs > 0; nlocs--) {
 					/* XXX add real error reporting */
 
 					ZGetLocations(&locs, &one);
+					/* TODO: Need to escape locs.host and locs.time? */
 					tmp = g_strdup_printf(_("<br>At %s since %s"), locs.host, locs.time);
 					purple_notify_user_info_add_pair(user_info, _("Location"), tmp);
 					g_free(tmp);
@@ -1173,15 +1176,18 @@
 					char *tmp;
 					const char *balias;
 
+					/* TODO: Check whether it's correct to call add_pair_html,
+					         or if we should be using add_pair_plaintext */
 					purple_notify_user_info_add_pair(user_info, _("User"), (b ? bname : user));
 
 					balias = b ? purple_buddy_get_local_buddy_alias(b) : NULL;
 					if (balias)
-						purple_notify_user_info_add_pair(user_info, _("Alias"), balias);
+						purple_notify_user_info_add_pair_plaintext(user_info, _("Alias"), balias);
 
 					if (!nlocs) {
-						purple_notify_user_info_add_pair(user_info, NULL, _("Hidden or not logged-in"));
+						purple_notify_user_info_add_pair_plaintext(user_info, NULL, _("Hidden or not logged-in"));
 					} else {
+						/* TODO: Need to escape the two strings that make up tmp? */
 						tmp = g_strdup_printf(_("<br>At %s since %s"),
 									  tree_child(tree_child(tree_child(tree_child(locations,2),0),0),2)->contents,
 									  tree_child(tree_child(tree_child(tree_child(locations,2),0),2),2)->contents);