diff libpurple/protocols/bonjour/bonjour.c @ 20308:c2d3c9fc71b5

applied changes from fbb7ffaf4075cf690cc3ff9d171e56320e9af8da through 6f133a093581cd9a632ca6d0ce110d180e582714
author Luke Schierer <lschiere@pidgin.im>
date Fri, 19 Oct 2007 17:10:04 +0000
parents 44b4e8bd759b
children 24ce4fcce5b0 f3cfcbbac3d8
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/bonjour.c	Fri Oct 19 17:09:19 2007 +0000
+++ b/libpurple/protocols/bonjour/bonjour.c	Fri Oct 19 17:10:04 2007 +0000
@@ -26,6 +26,7 @@
 #define UNICODE
 #include <windows.h>
 #include <lm.h>
+#include "dns_sd_proxy.h"
 #endif
 
 #include "internal.h"
@@ -99,6 +100,17 @@
 	PurpleStatus *status;
 	PurplePresence *presence;
 
+#ifdef _WIN32
+	if (!dns_sd_available()) {
+		gc->wants_to_die = TRUE;
+		purple_connection_error(gc,
+			_("The Apple Bonjour For Windows toolkit wasn't found, see the FAQ at: "
+			  "http://developer.pidgin.im/wiki/Using%20Pidgin#CanIusePidginforBonjourLink-LocalMessaging"
+			  " for more information."));
+		return;
+	}
+#endif
+
 	gc->flags |= PURPLE_CONNECTION_HTML;
 	gc->proto_data = bd = g_new0(BonjourData, 1);
 
@@ -155,13 +167,13 @@
 	BonjourData *bd = connection->proto_data;
 
 	/* Stop looking for buddies in the LAN */
-	if (bd->dns_sd_data != NULL)
+	if (bd != NULL && bd->dns_sd_data != NULL)
 	{
 		bonjour_dns_sd_stop(bd->dns_sd_data);
 		bonjour_dns_sd_free(bd->dns_sd_data);
 	}
 
-	if (bd->jabber_data != NULL)
+	if (bd != NULL && bd->jabber_data != NULL)
 	{
 		/* Stop waiting for conversations */
 		bonjour_jabber_stop(bd->jabber_data);