changeset 26939:e40a30c883cc

Correctly ignore Avahi's informational events when querying records for the buddy icon. This fixes missing icons with the cryptic "An unexpected D-Bus error occured (sic)" (since it wasn't really an error).
author Elliott Sales de Andrade <qulogic@pidgin.im>
date Sat, 23 May 2009 07:08:00 +0000
parents f2e4bc583e52
children 3fd5f2bccd68 e8795ced8c9b
files libpurple/protocols/bonjour/mdns_avahi.c
diffstat 1 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/bonjour/mdns_avahi.c	Fri May 22 06:01:12 2009 +0000
+++ b/libpurple/protocols/bonjour/mdns_avahi.c	Sat May 23 07:08:00 2009 +0000
@@ -357,14 +357,16 @@
 	AvahiBuddyImplData *idata = buddy->mdns_impl_data;
 
 	switch (event) {
+		case AVAHI_BROWSER_CACHE_EXHAUSTED:
+		case AVAHI_BROWSER_ALL_FOR_NOW:
+			/* Ignore these "meta" informational events */
+			return;
 		case AVAHI_BROWSER_NEW:
 			bonjour_buddy_got_buddy_icon(buddy, rdata, size);
 			break;
 		case AVAHI_BROWSER_REMOVE:
-		case AVAHI_BROWSER_CACHE_EXHAUSTED:
-		case AVAHI_BROWSER_ALL_FOR_NOW:
 		case AVAHI_BROWSER_FAILURE:
-			purple_debug_error("bonjour", "Error rerieving buddy icon record: %s\n",
+			purple_debug_error("bonjour", "Error retrieving buddy icon record: %s\n",
 				avahi_strerror(avahi_client_errno(avahi_record_browser_get_client(b))));
 			break;
 	}