comparison libpurple/protocols/jabber/jabber.c @ 26334:6f0200f1e497

Clean up usage of USE_VV in the XMPP protocol.
author Mike Ruprecht <maiku@soc.pidgin.im>
date Sat, 21 Mar 2009 09:07:06 +0000
parents 38238d41923b
children d06236d07c9e
comparison
equal deleted inserted replaced
26333:4143990b5c09 26334:6f0200f1e497
736 js->next_id = g_random_int(); 736 js->next_id = g_random_int();
737 js->write_buffer = purple_circ_buffer_new(512); 737 js->write_buffer = purple_circ_buffer_new(512);
738 js->old_length = 0; 738 js->old_length = 0;
739 js->keepalive_timeout = -1; 739 js->keepalive_timeout = -1;
740 js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user ? js->user->domain : NULL); 740 js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user ? js->user->domain : NULL);
741 #ifdef USE_VV
742 js->sessions = NULL; 741 js->sessions = NULL;
743 #endif
744
745 js->stun_ip = NULL; 742 js->stun_ip = NULL;
746 js->stun_port = 0; 743 js->stun_port = 0;
747 js->stun_query = NULL; 744 js->stun_query = NULL;
748 745
749 if(!js->user) { 746 if(!js->user) {
1338 1335
1339 void jabber_close(PurpleConnection *gc) 1336 void jabber_close(PurpleConnection *gc)
1340 { 1337 {
1341 JabberStream *js = gc->proto_data; 1338 JabberStream *js = gc->proto_data;
1342 1339
1343 #ifdef USE_VV
1344 /* Close all of the open Jingle sessions on this stream */ 1340 /* Close all of the open Jingle sessions on this stream */
1345 jingle_terminate_sessions(js); 1341 jingle_terminate_sessions(js);
1346 #endif
1347 1342
1348 /* Don't perform any actions on the ssl connection 1343 /* Don't perform any actions on the ssl connection
1349 * if we were forcibly disconnected because it will crash 1344 * if we were forcibly disconnected because it will crash
1350 * on some SSL backends. 1345 * on some SSL backends.
1351 */ 1346 */
2621 2616
2622 gboolean jabber_offline_message(const PurpleBuddy *buddy) 2617 gboolean jabber_offline_message(const PurpleBuddy *buddy)
2623 { 2618 {
2624 return TRUE; 2619 return TRUE;
2625 } 2620 }
2626 #ifdef USE_VV
2627 2621
2628 PurpleMedia * 2622 PurpleMedia *
2629 jabber_initiate_media(PurpleConnection *gc, const char *who, 2623 jabber_initiate_media(PurpleConnection *gc, const char *who,
2630 PurpleMediaSessionType type) 2624 PurpleMediaSessionType type)
2631 { 2625 {
2626 #ifdef USE_VV
2632 JabberStream *js = (JabberStream *) gc->proto_data; 2627 JabberStream *js = (JabberStream *) gc->proto_data;
2633 JabberBuddy *jb; 2628 JabberBuddy *jb;
2634 2629
2635 if (!js) { 2630 if (!js) {
2636 purple_debug_error("jabber", 2631 purple_debug_error("jabber",
2650 JINGLE_APP_RTP_SUPPORT_AUDIO) && 2645 JINGLE_APP_RTP_SUPPORT_AUDIO) &&
2651 jabber_buddy_has_capability(jb, GTALK_CAP)) 2646 jabber_buddy_has_capability(jb, GTALK_CAP))
2652 return jabber_google_session_initiate(gc->proto_data, who, type); 2647 return jabber_google_session_initiate(gc->proto_data, who, type);
2653 else 2648 else
2654 return jingle_rtp_initiate_media(gc->proto_data, who, type); 2649 return jingle_rtp_initiate_media(gc->proto_data, who, type);
2650 #else
2651 return NULL;
2652 #endif
2655 } 2653 }
2656 2654
2657 PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who) 2655 PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who)
2658 { 2656 {
2657 #ifdef USE_VV
2659 JabberStream *js = (JabberStream *) gc->proto_data; 2658 JabberStream *js = (JabberStream *) gc->proto_data;
2660 JabberBuddy *jb; 2659 JabberBuddy *jb;
2661 PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE; 2660 PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE;
2662 2661
2663 if (!js) { 2662 if (!js) {
2694 } 2693 }
2695 if (jabber_buddy_has_capability(jb, GTALK_CAP)) 2694 if (jabber_buddy_has_capability(jb, GTALK_CAP))
2696 caps |= PURPLE_MEDIA_CAPS_AUDIO; 2695 caps |= PURPLE_MEDIA_CAPS_AUDIO;
2697 2696
2698 return caps; 2697 return caps;
2699 } 2698 #else
2700 2699 return PURPLE_MEDIA_CAPS_NONE;
2701 #endif 2700 #endif
2701 }
2702 2702
2703 void jabber_register_commands(void) 2703 void jabber_register_commands(void)
2704 { 2704 {
2705 purple_cmd_register("config", "", PURPLE_CMD_P_PRPL, 2705 purple_cmd_register("config", "", PURPLE_CMD_P_PRPL,
2706 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY, 2706 PURPLE_CMD_FLAG_CHAT | PURPLE_CMD_FLAG_PRPL_ONLY,