changeset 22052:1be0d49532a1

Fix the _presence._tcp. record not to be referred to as the ICHAT_PRESENCE, that has been bothering me for a while.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 09 Jan 2008 19:07:16 +0000
parents 92eeb7f5b3c9
children 40a70eb8edb1
files libpurple/protocols/bonjour/mdns_avahi.c libpurple/protocols/bonjour/mdns_types.h libpurple/protocols/bonjour/mdns_win32.c
diffstat 3 files changed, 11 insertions(+), 11 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/mdns_avahi.c	Wed Jan 09 19:04:28 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_avahi.c	Wed Jan 09 19:07:16 2008 +0000
@@ -445,14 +445,14 @@
 				idata->group, AVAHI_IF_UNSPEC,
 				AVAHI_PROTO_INET, 0,
 				purple_account_get_username(data->account),
-				ICHAT_SERVICE, NULL, NULL, data->port_p2pj, lst);
+				LINK_LOCAL_RECORD_NAME, NULL, NULL, data->port_p2pj, lst);
 			break;
 		case PUBLISH_UPDATE:
 			publish_result = avahi_entry_group_update_service_txt_strlst(
 				idata->group, AVAHI_IF_UNSPEC,
 				AVAHI_PROTO_INET, 0,
 				purple_account_get_username(data->account),
-				ICHAT_SERVICE, NULL, lst);
+				LINK_LOCAL_RECORD_NAME, NULL, lst);
 			break;
 	}
 
@@ -461,7 +461,7 @@
 
 	if (publish_result < 0) {
 		purple_debug_error("bonjour",
-			"Failed to add the " ICHAT_SERVICE " service. Error: %s\n",
+			"Failed to add the " LINK_LOCAL_RECORD_NAME " service. Error: %s\n",
 			avahi_strerror(publish_result));
 		return FALSE;
 	}
@@ -469,7 +469,7 @@
 	if (type == PUBLISH_START
 			&& (publish_result = avahi_entry_group_commit(idata->group)) < 0) {
 		purple_debug_error("bonjour",
-			"Failed to commit " ICHAT_SERVICE " service. Error: %s\n",
+			"Failed to commit " LINK_LOCAL_RECORD_NAME " service. Error: %s\n",
 			avahi_strerror(publish_result));
 		return FALSE;
 	}
@@ -482,7 +482,7 @@
 
 	g_return_val_if_fail(idata != NULL, FALSE);
 
-	idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, ICHAT_SERVICE, NULL, 0, _browser_callback, data->account);
+	idata->sb = avahi_service_browser_new(idata->client, AVAHI_IF_UNSPEC, AVAHI_PROTO_INET, LINK_LOCAL_RECORD_NAME, NULL, 0, _browser_callback, data->account);
 	if (!idata->sb) {
 
 		purple_debug_error("bonjour",
@@ -524,7 +524,7 @@
 			return FALSE;
 		}
 
-		svc_name = g_strdup_printf("%s." ICHAT_SERVICE "local",
+		svc_name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local",
 				purple_account_get_username(data->account));
 
 		ret = avahi_entry_group_add_record(idata->buddy_icon_group, AVAHI_IF_UNSPEC,
@@ -615,7 +615,7 @@
 
 	purple_debug_info("bonjour", "Retrieving buddy icon for '%s'.\n", buddy->name);
 
-	name = g_strdup_printf("%s." ICHAT_SERVICE "local", buddy->name);
+	name = g_strdup_printf("%s." LINK_LOCAL_RECORD_NAME "local", buddy->name);
 	idata->buddy_icon_rec_browser = avahi_record_browser_new(session_idata->client, AVAHI_IF_UNSPEC,
 		AVAHI_PROTO_INET, name, AVAHI_DNS_CLASS_IN, AVAHI_DNS_TYPE_NULL, 0,
 		_buddy_icon_record_cb, buddy);
--- a/libpurple/protocols/bonjour/mdns_types.h	Wed Jan 09 19:04:28 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_types.h	Wed Jan 09 19:07:16 2008 +0000
@@ -20,7 +20,7 @@
 #include <glib.h>
 #include "account.h"
 
-#define ICHAT_SERVICE "_presence._tcp."
+#define LINK_LOCAL_RECORD_NAME "_presence._tcp."
 
 /**
  * Data to be used by the dns-sd connection.
--- a/libpurple/protocols/bonjour/mdns_win32.c	Wed Jan 09 19:04:28 2008 +0000
+++ b/libpurple/protocols/bonjour/mdns_win32.c	Wed Jan 09 19:07:16 2008 +0000
@@ -476,7 +476,7 @@
 		switch (type) {
 			case PUBLISH_START:
 				purple_debug_info("bonjour", "Registering presence on port %d\n", data->port_p2pj);
-				errorCode = DNSServiceRegister(&presence_sr, 0, 0, purple_account_get_username(data->account), ICHAT_SERVICE,
+				errorCode = DNSServiceRegister(&presence_sr, 0, 0, purple_account_get_username(data->account), LINK_LOCAL_RECORD_NAME,
 					NULL, NULL, htons(data->port_p2pj), TXTRecordGetLength(&dns_data), TXTRecordGetBytesPtr(&dns_data),
 					_mdns_service_register_callback, NULL);
 				break;
@@ -515,7 +515,7 @@
 
 	g_return_val_if_fail(idata != NULL, FALSE);
 
-	errorCode = DNSServiceBrowse(&browser_sr, 0, 0, ICHAT_SERVICE, NULL,
+	errorCode = DNSServiceBrowse(&browser_sr, 0, 0, LINK_LOCAL_RECORD_NAME, NULL,
 		_mdns_service_browse_callback, data->account);
 	if (errorCode == kDNSServiceErr_NoError) {
 		idata->browser_query = g_new(DnsSDServiceRefHandlerData, 1);
@@ -622,7 +622,7 @@
 		idata->null_query = NULL;
 	}
 
-	if (DNSServiceConstructFullName(svc_name, buddy->name, ICHAT_SERVICE, "local") != 0)
+	if (DNSServiceConstructFullName(svc_name, buddy->name, LINK_LOCAL_RECORD_NAME, "local") != 0)
 		purple_debug_error("bonjour", "Unable to construct full name to retrieve buddy icon for %s.\n", buddy->name);
 	else {
 		DNSServiceRef null_query_sr;