diff src/protocols/bonjour/dns_sd.c @ 13906:b986b6e2441b

[gaim-migrate @ 16400] part of sf patch #1490646, from Jonty Wareing & Jono Cole "The user can now specify their AIM and Jabber ID in the preferences" committer: Tailor Script <tailor@pidgin.im>
author Mark Doliner <mark@kingant.net>
date Sun, 02 Jul 2006 21:52:06 +0000
parents b10030f6eab7
children 8264f52a1142
line wrap: on
line diff
--- a/src/protocols/bonjour/dns_sd.c	Sun Jul 02 09:37:25 2006 +0000
+++ b/src/protocols/bonjour/dns_sd.c	Sun Jul 02 21:52:06 2006 +0000
@@ -251,11 +251,19 @@
 	sw_text_record_add_key_and_string_value(dns_data, "port.p2pj", BONJOUR_DEFAULT_PORT);
 	sw_text_record_add_key_and_string_value(dns_data, "phsh", data->phsh);
 	sw_text_record_add_key_and_string_value(dns_data, "status", data->status);
-	sw_text_record_add_key_and_string_value(dns_data, "msg", data->msg);
-	sw_text_record_add_key_and_string_value(dns_data, "email", data->email);
 	sw_text_record_add_key_and_string_value(dns_data, "vc", data->vc);
-	sw_text_record_add_key_and_string_value(dns_data, "jid", data->jid);
-	sw_text_record_add_key_and_string_value(dns_data, "AIM", data->AIM);
+
+	if ((data->email != NULL) && (*data->email != '\0'))
+		sw_text_record_add_key_and_string_value(dns_data, "email", data->email);
+
+	if ((data->jid != NULL) && (*data->jid != '\0'))
+		sw_text_record_add_key_and_string_value(dns_data, "jid", data->jid);
+
+	if ((data->AIM != NULL) && (*data->AIM != '\0'))
+		sw_text_record_add_key_and_string_value(dns_data, "AIM", data->AIM);
+
+	if ((data->msg != NULL) && (*data->msg != '\0'))
+		sw_text_record_add_key_and_string_value(dns_data, "msg", data->msg);
 
 	/* Publish the service */
 	switch (type)