comparison libpurple/protocols/jabber/jabber.c @ 30515:7f1da2fbe7fc

propagate from branch 'im.pidgin.pidgin' (head a582dd339f019301adca693df4b1a8fb135a1774) to branch 'im.pidgin.cpw.malu.xmpp.google_relay' (head ed59323895a1ea93985fe761fbd1749dd8af5638)
author Marcus Lundblad <ml@update.uu.se>
date Sun, 06 Dec 2009 19:06:42 +0000
parents 0f7025534fc5 ef2c74d0ef19
children 105437d8253f
comparison
equal deleted inserted replaced
28765:edf0aa0e55cb 30515:7f1da2fbe7fc
855 js->protocol_version = JABBER_PROTO_1_0; 855 js->protocol_version = JABBER_PROTO_1_0;
856 js->sessions = NULL; 856 js->sessions = NULL;
857 js->stun_ip = NULL; 857 js->stun_ip = NULL;
858 js->stun_port = 0; 858 js->stun_port = 0;
859 js->stun_query = NULL; 859 js->stun_query = NULL;
860 js->google_relay_token = NULL;
861 js->google_relay_host = NULL;
862 js->google_relay_requests = NULL;
860 863
861 /* if we are idle, set idle-ness on the stream (this could happen if we get 864 /* if we are idle, set idle-ness on the stream (this could happen if we get
862 disconnected and the reconnects while being idle. I don't think it makes 865 disconnected and the reconnects while being idle. I don't think it makes
863 sense to do this when registering a new account... */ 866 sense to do this when registering a new account... */
864 presence = purple_account_get_presence(account); 867 presence = purple_account_get_presence(account);
1557 1560
1558 /* cancel DNS query for STUN, if one is ongoing */ 1561 /* cancel DNS query for STUN, if one is ongoing */
1559 if (js->stun_query) { 1562 if (js->stun_query) {
1560 purple_dnsquery_destroy(js->stun_query); 1563 purple_dnsquery_destroy(js->stun_query);
1561 js->stun_query = NULL; 1564 js->stun_query = NULL;
1565 }
1566
1567 /* remove Google relay-related stuff */
1568 g_free(js->google_relay_token);
1569 g_free(js->google_relay_host);
1570 if (js->google_relay_requests) {
1571 while (js->google_relay_requests) {
1572 PurpleUtilFetchUrlData *url_data =
1573 (PurpleUtilFetchUrlData *) js->google_relay_requests->data;
1574 purple_util_fetch_url_cancel(url_data);
1575 g_free(url_data);
1576 js->google_relay_requests =
1577 g_list_delete_link(js->google_relay_requests,
1578 js->google_relay_requests);
1579 }
1562 } 1580 }
1563 1581
1564 g_free(js); 1582 g_free(js);
1565 1583
1566 gc->proto_data = NULL; 1584 gc->proto_data = NULL;
3018 3036
3019 jb = jabber_buddy_find(js, who, FALSE); 3037 jb = jabber_buddy_find(js, who, FALSE);
3020 jbr = jabber_buddy_find_resource(jb, resource); 3038 jbr = jabber_buddy_find_resource(jb, resource);
3021 g_free(resource); 3039 g_free(resource);
3022 3040
3023 if (type & PURPLE_MEDIA_AUDIO && 3041 /* if we are on a Google Talk connection and the remote supports
3024 !jabber_resource_has_capability(jbr, 3042 Google Jingle, we will go with that */
3025 JINGLE_APP_RTP_SUPPORT_AUDIO) && 3043 if (((js->googletalk && js->google_relay_token) ||
3026 jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE)) 3044 !jabber_resource_has_capability(jbr, JINGLE_APP_RTP_SUPPORT_AUDIO))
3045 && (((type & PURPLE_MEDIA_AUDIO) &&
3046 jabber_resource_has_capability(jbr, NS_GOOGLE_VOICE))
3047 || ((type & PURPLE_MEDIA_VIDEO) &&
3048 jabber_resource_has_capability(jbr, NS_GOOGLE_VIDEO))))
3027 return jabber_google_session_initiate(js, who, type); 3049 return jabber_google_session_initiate(js, who, type);
3028 else 3050 else
3029 return jingle_rtp_initiate_media(js, who, type); 3051 return jingle_rtp_initiate_media(js, who, type);
3030 } 3052 }
3031 3053