| 346 const char *from, xmlnode *iq, gpointer data) |
346 const char *from, xmlnode *iq, gpointer data) |
| 347 { |
347 { |
| 348 struct item_data *item_data = data; |
348 struct item_data *item_data = data; |
| 349 PidginDiscoList *list = item_data->list; |
349 PidginDiscoList *list = item_data->list; |
| 350 xmlnode *query; |
350 xmlnode *query; |
| |
351 gboolean has_items = FALSE; |
| 351 |
352 |
| 352 --list->fetch_count; |
353 --list->fetch_count; |
| 353 |
354 |
| 354 if (!list->in_progress) |
355 if (!list->in_progress) |
| 355 goto out; |
356 goto out; |
| 361 for (item = xmlnode_get_child(query, "item"); item; |
362 for (item = xmlnode_get_child(query, "item"); item; |
| 362 item = xmlnode_get_next_twin(item)) { |
363 item = xmlnode_get_next_twin(item)) { |
| 363 const char *jid = xmlnode_get_attrib(item, "jid"); |
364 const char *jid = xmlnode_get_attrib(item, "jid"); |
| 364 const char *name = xmlnode_get_attrib(item, "name"); |
365 const char *name = xmlnode_get_attrib(item, "name"); |
| 365 const char *node = xmlnode_get_attrib(item, "node"); |
366 const char *node = xmlnode_get_attrib(item, "node"); |
| |
367 |
| |
368 has_items = TRUE; |
| 366 |
369 |
| 367 if (item_data->parent->type == XMPP_DISCO_SERVICE_TYPE_CHAT) { |
370 if (item_data->parent->type == XMPP_DISCO_SERVICE_TYPE_CHAT) { |
| 368 /* This is a hacky first-order approximation. Any MUC |
371 /* This is a hacky first-order approximation. Any MUC |
| 369 * component that has a >1 level hierarchy (a Yahoo MUC |
372 * component that has a >1 level hierarchy (a Yahoo MUC |
| 370 * transport component probably does) will violate this. |
373 * transport component probably does) will violate this. |
| 394 pidgin_disco_list_ref(list); |
397 pidgin_disco_list_ref(list); |
| 395 xmpp_disco_info_do(pc, item_data2, jid, node, got_info_cb); |
398 xmpp_disco_info_do(pc, item_data2, jid, node, got_info_cb); |
| 396 } |
399 } |
| 397 } |
400 } |
| 398 } |
401 } |
| |
402 |
| |
403 if (!has_items) |
| |
404 pidgin_disco_add_service(list, NULL, item_data->parent); |
| 399 |
405 |
| 400 out: |
406 out: |
| 401 if (list->fetch_count == 0) |
407 if (list->fetch_count == 0) |
| 402 pidgin_disco_list_set_in_progress(list, FALSE); |
408 pidgin_disco_list_set_in_progress(list, FALSE); |
| 403 |
409 |