changeset 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 4e44ecb866bd
children cc60d0861337
files src/protocols/bonjour/bonjour.c src/protocols/bonjour/dns_sd.c
diffstat 2 files changed, 20 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/src/protocols/bonjour/bonjour.c	Sun Jul 02 09:37:25 2006 +0000
+++ b/src/protocols/bonjour/bonjour.c	Sun Jul 02 21:52:06 2006 +0000
@@ -127,8 +127,8 @@
 	bd->dns_sd_data->phsh = g_strdup("");
 	bd->dns_sd_data->email = g_strdup(gaim_account_get_string(account, "email", ""));
 	bd->dns_sd_data->vc = g_strdup("");
-	bd->dns_sd_data->jid = g_strdup("");
-	bd->dns_sd_data->AIM = g_strdup("");
+	bd->dns_sd_data->jid = g_strdup(gaim_account_get_string(account, "jid", ""));
+	bd->dns_sd_data->AIM = g_strdup(gaim_account_get_string(account, "AIM", ""));
 
 	status = gaim_account_get_active_status(account);
 	presence = gaim_account_get_presence(account);
@@ -588,6 +588,12 @@
 	option = gaim_account_option_string_new(_("E-mail"), "email", "");
 	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
 
+	option = gaim_account_option_string_new(_("AIM Account"), "AIM", "");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
+	option = gaim_account_option_string_new(_("Jabber Account"), "jid", "");
+	prpl_info.protocol_options = g_list_append(prpl_info.protocol_options, option);
+
 	my_protocol = plugin;
 }
 
--- 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)