changeset 31900:ce6ef84fb8a0

Simplify. This is 6 lines instead of 15.
author Mark Doliner <mark@kingant.net>
date Sun, 21 Aug 2011 18:04:00 +0000
parents 1aa7d06e30c0
children dc3ea8f6381a
files libpurple/protocols/yahoo/libymsg.c
diffstat 1 files changed, 6 insertions(+), 15 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/yahoo/libymsg.c	Sun Aug 21 18:00:53 2011 +0000
+++ b/libpurple/protocols/yahoo/libymsg.c	Sun Aug 21 18:04:00 2011 +0000
@@ -4036,21 +4036,12 @@
 
 	if (f && full) {
 		YahooPersonalDetails *ypd = &f->ypd;
-		int i;
-		struct {
-			char *text;
-			char *value;
-		} yfields[] = {
-			{N_("Home Phone Number"), ypd->phone.home},
-			{N_("Work Phone Number"), ypd->phone.work},
-			{N_("Mobile Phone Number"), ypd->phone.mobile},
-			{NULL, NULL}
-		};
-		for (i = 0; yfields[i].text; i++) {
-			if (!yfields[i].value || !*yfields[i].value)
-				continue;
-			purple_notify_user_info_add_pair(user_info, _(yfields[i].text), yfields[i].value);
-		}
+		if (ypd->phone.home && *ypd->phone.home)
+			purple_notify_user_info_add_pair(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);
+		if (ypd->phone.mobile && *ypd->phone.mobile)
+			purple_notify_user_info_add_pair(user_info, _("Mobile Phone Number"), ypd->phone.mobile);
 	}
 }