| 517 } |
517 } |
| 518 |
518 |
| 519 for (child = xmlnode_get_child(query, "identity"); child; |
519 for (child = xmlnode_get_child(query, "identity"); child; |
| 520 child = xmlnode_get_next_twin(child)) { |
520 child = xmlnode_get_next_twin(child)) { |
| 521 const char *category, *type, *name; |
521 const char *category, *type, *name; |
| |
522 const char *stun_ip; |
| 522 category = xmlnode_get_attrib(child, "category"); |
523 category = xmlnode_get_attrib(child, "category"); |
| 523 type = xmlnode_get_attrib(child, "type"); |
524 type = xmlnode_get_attrib(child, "type"); |
| 524 if(purple_strequal(category, "pubsub") && purple_strequal(type, "pep")) { |
525 if(purple_strequal(category, "pubsub") && purple_strequal(type, "pep")) { |
| 525 PurpleConnection *gc = js->gc; |
526 PurpleConnection *gc = js->gc; |
| 526 js->pep = TRUE; |
527 js->pep = TRUE; |
| 536 if (!name) |
537 if (!name) |
| 537 continue; |
538 continue; |
| 538 |
539 |
| 539 g_free(js->server_name); |
540 g_free(js->server_name); |
| 540 js->server_name = g_strdup(name); |
541 js->server_name = g_strdup(name); |
| |
542 stun_ip = purple_network_get_stun_ip(); |
| 541 if (purple_strequal(name, "Google Talk")) { |
543 if (purple_strequal(name, "Google Talk")) { |
| 542 purple_debug_info("jabber", "Google Talk!\n"); |
544 purple_debug_info("jabber", "Google Talk!\n"); |
| 543 js->googletalk = TRUE; |
545 js->googletalk = TRUE; |
| 544 |
546 |
| 545 /* autodiscover stun and relays */ |
547 /* autodiscover stun and relays */ |
| 546 if (purple_network_get_stun_ip() == NULL || |
548 if (stun_ip == NULL || stun_ip[0] == '\0') { |
| 547 purple_strequal(purple_network_get_stun_ip(), "")) { |
|
| 548 jabber_google_send_jingle_info(js); |
549 jabber_google_send_jingle_info(js); |
| 549 } |
550 } |
| 550 } else if (purple_network_get_stun_ip() == NULL || |
551 } else if (stun_ip == NULL || stun_ip[0] == '\0') { |
| 551 purple_strequal(purple_network_get_stun_ip(), "")) { |
|
| 552 js->srv_query_data = |
552 js->srv_query_data = |
| 553 purple_srv_resolve_account( |
553 purple_srv_resolve_account( |
| 554 purple_connection_get_account(js->gc), "stun", "udp", |
554 purple_connection_get_account(js->gc), "stun", "udp", |
| 555 js->user->domain, |
555 js->user->domain, |
| 556 jabber_disco_stun_srv_resolve_cb, js); |
556 jabber_disco_stun_srv_resolve_cb, js); |