# HG changeset patch # User Paul Aurich # Date 1244004906 0 # Node ID 61d817c4c935b32c853d4197bb4f9383d871bfa1 # Parent b709ab0cb4bcb5abe0f35bd1d0c4a7d9e02aa92d Remove the pseudo-row child of expandable services if there are no children. Patch from nops. Refs #556. diff -r b709ab0cb4bc -r 61d817c4c935 pidgin/plugins/disco/gtkdisco.c --- a/pidgin/plugins/disco/gtkdisco.c Wed Jun 03 04:32:19 2009 +0000 +++ b/pidgin/plugins/disco/gtkdisco.c Wed Jun 03 04:55:06 2009 +0000 @@ -512,7 +512,10 @@ dialog = pdl->dialog; g_return_if_fail(dialog != NULL); - purple_debug_info("xmppdisco", "Adding service \"%s\"\n", service->name); + if (service != NULL) + purple_debug_info("xmppdisco", "Adding service \"%s\"\n", service->name); + else + purple_debug_info("xmppdisco", "Service \"%s\" has no childrens\n", parent->name); gtk_progress_bar_pulse(GTK_PROGRESS_BAR(dialog->progress)); @@ -537,6 +540,12 @@ } } + if (service == NULL) { + if (parent != NULL && !append) + gtk_tree_store_remove(pdl->model, &child); + return; + } + if (append) gtk_tree_store_append(pdl->model, &iter, (parent ? &parent_iter : NULL)); else diff -r b709ab0cb4bc -r 61d817c4c935 pidgin/plugins/disco/xmppdisco.c --- a/pidgin/plugins/disco/xmppdisco.c Wed Jun 03 04:32:19 2009 +0000 +++ b/pidgin/plugins/disco/xmppdisco.c Wed Jun 03 04:55:06 2009 +0000 @@ -348,6 +348,7 @@ struct item_data *item_data = data; PidginDiscoList *list = item_data->list; xmlnode *query; + gboolean has_items = FALSE; --list->fetch_count; @@ -364,6 +365,8 @@ const char *name = xmlnode_get_attrib(item, "name"); const char *node = xmlnode_get_attrib(item, "node"); + has_items = TRUE; + if (item_data->parent->type == XMPP_DISCO_SERVICE_TYPE_CHAT) { /* This is a hacky first-order approximation. Any MUC * component that has a >1 level hierarchy (a Yahoo MUC @@ -397,6 +400,9 @@ } } + if (!has_items) + pidgin_disco_add_service(list, NULL, item_data->parent); + out: if (list->fetch_count == 0) pidgin_disco_list_set_in_progress(list, FALSE);