| 445 } |
445 } |
| 446 |
446 |
| 447 jbr->caps.info = info; |
447 jbr->caps.info = info; |
| 448 jbr->caps.exts = exts; |
448 jbr->caps.exts = exts; |
| 449 |
449 |
| |
450 if (info == NULL) |
| |
451 goto out; |
| |
452 |
| 450 if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) { |
453 if (!jbr->commands_fetched && jabber_resource_has_capability(jbr, "http://jabber.org/protocol/commands")) { |
| 451 JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
454 JabberIq *iq = jabber_iq_new_query(userdata->js, JABBER_IQ_GET, "http://jabber.org/protocol/disco#items"); |
| 452 xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items"); |
455 xmlnode *query = xmlnode_get_child_with_namespace(iq->node, "query", "http://jabber.org/protocol/disco#items"); |
| 453 xmlnode_set_attrib(iq->node, "to", userdata->from); |
456 xmlnode_set_attrib(iq->node, "to", userdata->from); |
| 454 xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); |
457 xmlnode_set_attrib(query, "node", "http://jabber.org/protocol/commands"); |
| 456 jabber_iq_send(iq); |
459 jabber_iq_send(iq); |
| 457 |
460 |
| 458 jbr->commands_fetched = TRUE; |
461 jbr->commands_fetched = TRUE; |
| 459 } |
462 } |
| 460 |
463 |
| |
464 if (jabber_resource_has_capability(jbr, "http://jabber.org/protocol/chatstates")) |
| |
465 jbr->chat_states = JABBER_CHAT_STATES_SUPPORTED; |
| |
466 else |
| |
467 jbr->chat_states = JABBER_CHAT_STATES_UNSUPPORTED; |
| |
468 |
| |
469 out: |
| 461 g_free(userdata->from); |
470 g_free(userdata->from); |
| 462 g_free(userdata); |
471 g_free(userdata); |
| 463 } |
472 } |
| 464 |
473 |
| 465 void jabber_presence_parse(JabberStream *js, xmlnode *packet) |
474 void jabber_presence_parse(JabberStream *js, xmlnode *packet) |