changeset 25874:71aafff24358

Backport ab47b66449b213d6fbfc728cc1e8c161bed87755 (#8782 - Fix persistent Bonjour buddies.)
author Daniel Atallah <daniel.atallah@gmail.com>
date Thu, 30 Apr 2009 05:16:29 +0000
parents 21a90a4c76d6
children dfd7be3e3cb7
files libpurple/protocols/bonjour/mdns_win32.c
diffstat 1 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/mdns_win32.c	Thu Apr 30 05:14:38 2009 +0000
+++ b/libpurple/protocols/bonjour/mdns_win32.c	Thu Apr 30 05:16:29 2009 +0000
@@ -169,14 +169,17 @@
 	gboolean delete_buddy = FALSE;
 	PurpleBuddy *pb = NULL;
 
+	if ((pb = purple_find_buddy(args->account, args->res_data->name))) {
+		if (pb->proto_data != args->bb) {
+			purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record.",
+				args->res_data->name);
+			goto cleanup;
+		}
 	/* Make sure that the BonjourBuddy associated with this request is still around */
-	if (g_slist_find(pending_buddies, args->bb) == NULL)
+	} else if (g_slist_find(pending_buddies, args->bb) == NULL) {
+		purple_debug_error("bonjour", "host resolution - complete, but buddy no longer pending.\n");
 		goto cleanup;
-
-	if ((pb = purple_find_buddy(args->account, args->bb->name)))
-		if (pb->proto_data != args->bb)
-			purple_debug_error("bonjour", "Found purple buddy for %s not matching bonjour buddy record. "
-				"This is going to be ugly!.\n", args->bb->name);
+	}
 
 	if (!hosts || !hosts->data) {
 		purple_debug_error("bonjour", "host resolution - callback error.\n");