comparison libpurple/protocols/bonjour/bonjour.c @ 20761:fb70e89180a9

Don't link the bonjour prpl on win32 directly to the Apple Bonjour library, instead do everything indirectly and display an error message at login time indicating that Bonjour isn't installed. This should make the prpl more discoverable.
author Daniel Atallah <daniel.atallah@gmail.com>
date Wed, 03 Oct 2007 00:47:25 +0000
parents 44b4e8bd759b
children 24ce4fcce5b0 f3cfcbbac3d8
comparison
equal deleted inserted replaced
20760:47fed8fe4884 20761:fb70e89180a9
24 #include <pwd.h> 24 #include <pwd.h>
25 #else 25 #else
26 #define UNICODE 26 #define UNICODE
27 #include <windows.h> 27 #include <windows.h>
28 #include <lm.h> 28 #include <lm.h>
29 #include "dns_sd_proxy.h"
29 #endif 30 #endif
30 31
31 #include "internal.h" 32 #include "internal.h"
32 33
33 #include "account.h" 34 #include "account.h"
97 PurpleGroup *bonjour_group; 98 PurpleGroup *bonjour_group;
98 BonjourData *bd; 99 BonjourData *bd;
99 PurpleStatus *status; 100 PurpleStatus *status;
100 PurplePresence *presence; 101 PurplePresence *presence;
101 102
103 #ifdef _WIN32
104 if (!dns_sd_available()) {
105 gc->wants_to_die = TRUE;
106 purple_connection_error(gc,
107 _("The Apple Bonjour For Windows toolkit wasn't found, see the FAQ at: "
108 "http://developer.pidgin.im/wiki/Using%20Pidgin#CanIusePidginforBonjourLink-LocalMessaging"
109 " for more information."));
110 return;
111 }
112 #endif
113
102 gc->flags |= PURPLE_CONNECTION_HTML; 114 gc->flags |= PURPLE_CONNECTION_HTML;
103 gc->proto_data = bd = g_new0(BonjourData, 1); 115 gc->proto_data = bd = g_new0(BonjourData, 1);
104 116
105 /* Start waiting for jabber connections (iChat style) */ 117 /* Start waiting for jabber connections (iChat style) */
106 bd->jabber_data = g_new(BonjourJabber, 1); 118 bd->jabber_data = g_new(BonjourJabber, 1);
153 { 165 {
154 PurpleGroup *bonjour_group; 166 PurpleGroup *bonjour_group;
155 BonjourData *bd = connection->proto_data; 167 BonjourData *bd = connection->proto_data;
156 168
157 /* Stop looking for buddies in the LAN */ 169 /* Stop looking for buddies in the LAN */
158 if (bd->dns_sd_data != NULL) 170 if (bd != NULL && bd->dns_sd_data != NULL)
159 { 171 {
160 bonjour_dns_sd_stop(bd->dns_sd_data); 172 bonjour_dns_sd_stop(bd->dns_sd_data);
161 bonjour_dns_sd_free(bd->dns_sd_data); 173 bonjour_dns_sd_free(bd->dns_sd_data);
162 } 174 }
163 175
164 if (bd->jabber_data != NULL) 176 if (bd != NULL && bd->jabber_data != NULL)
165 { 177 {
166 /* Stop waiting for conversations */ 178 /* Stop waiting for conversations */
167 bonjour_jabber_stop(bd->jabber_data); 179 bonjour_jabber_stop(bd->jabber_data);
168 g_free(bd->jabber_data); 180 g_free(bd->jabber_data);
169 } 181 }