| 175 DNSServiceRefDeallocate(args->resolver_query->sdRef); |
175 DNSServiceRefDeallocate(args->resolver_query->sdRef); |
| 176 g_free(args->resolver_query); |
176 g_free(args->resolver_query); |
| 177 args->resolver_query = NULL; |
177 args->resolver_query = NULL; |
| 178 |
178 |
| 179 if ((pb = purple_find_buddy(args->account, args->res_data->name))) { |
179 if ((pb = purple_find_buddy(args->account, args->res_data->name))) { |
| 180 if (pb->proto_data != args->bb) { |
180 if (purple_buddy_get_protocol_data(pb) != args->bb) { |
| 181 purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.", |
181 purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.", |
| 182 args->res_data->name); |
182 args->res_data->name); |
| 183 goto cleanup; |
183 goto cleanup; |
| 184 } |
184 } |
| 185 /* Make sure that the BonjourBuddy associated with this request is still around */ |
185 /* Make sure that the BonjourBuddy associated with this request is still around */ |
| 346 Win32SvcResolverData *rd; |
346 Win32SvcResolverData *rd; |
| 347 Win32BuddyImplData *idata; |
347 Win32BuddyImplData *idata; |
| 348 |
348 |
| 349 /* Is there an existing buddy? */ |
349 /* Is there an existing buddy? */ |
| 350 if ((pb = purple_find_buddy(account, serviceName))) |
350 if ((pb = purple_find_buddy(account, serviceName))) |
| 351 bb = pb->proto_data; |
351 bb = purple_buddy_get_protocol_data(pb); |
| 352 /* Is there a pending buddy? */ |
352 /* Is there a pending buddy? */ |
| 353 else { |
353 else { |
| 354 while (tmp) { |
354 while (tmp) { |
| 355 BonjourBuddy *bb_tmp = tmp->data; |
355 BonjourBuddy *bb_tmp = tmp->data; |
| 356 if (!strcmp(bb_tmp->name, serviceName)) { |
356 if (!strcmp(bb_tmp->name, serviceName)) { |
| 366 |
366 |
| 367 /* This is only necessary for the wacky case where someone previously manually added a buddy. */ |
367 /* This is only necessary for the wacky case where someone previously manually added a buddy. */ |
| 368 if (pb == NULL) |
368 if (pb == NULL) |
| 369 pending_buddies = g_slist_prepend(pending_buddies, bb); |
369 pending_buddies = g_slist_prepend(pending_buddies, bb); |
| 370 else |
370 else |
| 371 pb->proto_data = bb; |
371 purple_buddy_set_protocol_data(pb, bb); |
| 372 } |
372 } |
| 373 |
373 |
| 374 rd = g_new0(Win32SvcResolverData, 1); |
374 rd = g_new0(Win32SvcResolverData, 1); |
| 375 rd->if_idx = interfaceIndex; |
375 rd->if_idx = interfaceIndex; |
| 376 rd->name = g_strdup(serviceName); |
376 rd->name = g_strdup(serviceName); |
| 406 pb = purple_find_buddy(account, serviceName); |
406 pb = purple_find_buddy(account, serviceName); |
| 407 if (pb != NULL) { |
407 if (pb != NULL) { |
| 408 GSList *l; |
408 GSList *l; |
| 409 /* There may be multiple presences, we should only get rid of this one */ |
409 /* There may be multiple presences, we should only get rid of this one */ |
| 410 Win32SvcResolverData *rd_search; |
410 Win32SvcResolverData *rd_search; |
| 411 BonjourBuddy *bb = pb->proto_data; |
411 BonjourBuddy *bb = purple_buddy_get_protocol_data(pb); |
| 412 Win32BuddyImplData *idata; |
412 Win32BuddyImplData *idata; |
| 413 |
413 |
| 414 g_return_if_fail(bb != NULL); |
414 g_return_if_fail(bb != NULL); |
| 415 |
415 |
| 416 idata = bb->mdns_impl_data; |
416 idata = bb->mdns_impl_data; |