diff libpurple/protocols/bonjour/bonjour.c @ 24654:efe41c4e0df0

Fix Bonjour to better deal with buddy values set to the empty string.
author Richard Laager <rlaager@wiktel.com>
date Mon, 08 Dec 2008 05:20:44 +0000
parents c06b85e1d020
children f38799160cfa 367b3ddcf5c3 68f4edb42f39
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/bonjour.c	Sun Dec 07 02:36:57 2008 +0000
+++ b/libpurple/protocols/bonjour/bonjour.c	Mon Dec 08 05:20:44 2008 +0000
@@ -376,20 +376,20 @@
 	}
 
 	/* Only show first/last name if there is a nickname set (to avoid duplication) */
-	if (bb->nick != NULL) {
-		if (bb->first != NULL)
+	if (bb->nick != NULL && *bb->nick != '\0') {
+		if (bb->first != NULL && *bb->first != '\0')
 			purple_notify_user_info_add_pair(user_info, _("First name"), bb->first);
-		if (bb->first != NULL)
+		if (bb->last != NULL && *bb->last != '\0')
 			purple_notify_user_info_add_pair(user_info, _("Last name"), bb->last);
 	}
 
-	if (bb->email != NULL)
+	if (bb->email != NULL && *bb->email != '\0')
 		purple_notify_user_info_add_pair(user_info, _("Email"), bb->email);
 
-	if (bb->AIM != NULL)
+	if (bb->AIM != NULL && *bb->AIM != '\0')
 		purple_notify_user_info_add_pair(user_info, _("AIM Account"), bb->AIM);
 
-	if (bb->jid!= NULL)
+	if (bb->jid != NULL && *bb->jid != '\0')
 		purple_notify_user_info_add_pair(user_info, _("XMPP Account"), bb->jid);
 }