| 427 } |
427 } |
| 428 |
428 |
| 429 jbr->caps.info = info; |
429 jbr->caps.info = info; |
| 430 jbr->caps.exts = exts; |
430 jbr->caps.exts = exts; |
| 431 |
431 |
| 432 if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) { |
432 if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) { |
| 433 JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
433 JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
| 434 xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items"); |
434 xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items"); |
| 435 xmlnode_set_attrib(iq->node, "to", userdata->from); |
435 xmlnode_set_attrib(iq->node, "to", userdata->from); |
| 436 xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); |
436 xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); |
| 437 jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL); |
437 jabber_iq_set_callback(iq, jabber_adhoc_disco_result_cb, NULL); |
| 438 jabber_iq_send(iq); |
438 jabber_iq_send(iq); |
| |
439 |
| |
440 jbr->commands_fetched = TRUE; |
| 439 } |
441 } |
| 440 |
442 |
| 441 g_free(userdata->from); |
443 g_free(userdata->from); |
| 442 g_free(userdata); |
444 g_free(userdata); |
| 443 } |
445 } |