changeset 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 4143990b5c09
children d06236d07c9e
files libpurple/protocols/jabber/google.c libpurple/protocols/jabber/iq.c libpurple/protocols/jabber/jabber.c libpurple/protocols/jabber/jabber.h libpurple/protocols/jabber/libxmpp.c
diffstat 5 files changed, 17 insertions(+), 30 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google.c	Sat Mar 21 07:53:22 2009 +0000
+++ b/libpurple/protocols/jabber/google.c	Sat Mar 21 09:07:06 2009 +0000
@@ -510,12 +510,10 @@
 		google_session_handle_candidates(js, session, packet, sess);
 	}
 }
-#endif /* USE_VV */
 
 void
 jabber_google_session_parse(JabberStream *js, xmlnode *packet)
 {
-#ifdef USE_VV
 	GoogleSession *session = NULL;
 	GoogleSessionId id;
 
@@ -572,10 +570,8 @@
 	session->remote_jid = g_strdup(session->id.initiator);
 
 	google_session_parse_iq(js, session, packet);
-#else
-	/* TODO: send proper error response */
+}
 #endif /* USE_VV */
-}
 
 static void
 jabber_gmail_parse(JabberStream *js, xmlnode *packet, gpointer nul)
--- a/libpurple/protocols/jabber/iq.c	Sat Mar 21 07:53:22 2009 +0000
+++ b/libpurple/protocols/jabber/iq.c	Sat Mar 21 09:07:06 2009 +0000
@@ -372,11 +372,13 @@
 			return;
 		}
 	}
-	
+
+#ifdef USE_VV
 	if (xmlnode_get_child_with_namespace(packet, "session", "http://www.google.com/session")) {
 		jabber_google_session_parse(js, packet);
 		return;
 	}
+#endif
 
 	if(xmlnode_get_child_with_namespace(packet, "si", "http://jabber.org/protocol/si")) {
 		jabber_si_parse(js, packet);
@@ -406,13 +408,11 @@
 		jabber_ibb_parse(js, packet);
 		return;
 	}
-	
-#ifdef USE_VV
+
 	if (xmlnode_get_child_with_namespace(packet, "jingle", JINGLE)) {
 		jingle_parse(js, packet);
 		return;
 	}
-#endif
 
 	/* If we get here, send the default error reply mandated by XMPP-CORE */
 	if(!strcmp(type, "set") || !strcmp(type, "get")) {
@@ -453,9 +453,8 @@
 	jabber_iq_register_handler("http://jabber.org/protocol/disco#items", jabber_disco_items_parse);
 	jabber_iq_register_handler("jabber:iq:register", jabber_register_parse);
 	jabber_iq_register_handler("urn:xmpp:ping", urn_xmpp_ping_parse);
-#ifdef USE_VV
 	jabber_iq_register_handler(JINGLE, jingle_parse);
-#endif
+
 	/* handle Google jingleinfo */
 	jabber_iq_register_handler(GOOGLE_JINGLE_INFO_NAMESPACE, 
 		jabber_google_handle_jingle_info);
--- a/libpurple/protocols/jabber/jabber.c	Sat Mar 21 07:53:22 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.c	Sat Mar 21 09:07:06 2009 +0000
@@ -738,10 +738,7 @@
 	js->old_length = 0;
 	js->keepalive_timeout = -1;
 	js->certificate_CN = g_strdup(connect_server[0] ? connect_server : js->user ? js->user->domain : NULL);
-#ifdef USE_VV
 	js->sessions = NULL;
-#endif
-
 	js->stun_ip = NULL;
 	js->stun_port = 0;
 	js->stun_query = NULL;
@@ -1340,10 +1337,8 @@
 {
 	JabberStream *js = gc->proto_data;
 
-#ifdef USE_VV
 	/* Close all of the open Jingle sessions on this stream */
 	jingle_terminate_sessions(js);
-#endif
 
 	/* Don't perform any actions on the ssl connection
 	 * if we were forcibly disconnected because it will crash
@@ -2623,12 +2618,12 @@
 {
 	return TRUE;
 }
-#ifdef USE_VV
 
 PurpleMedia *
 jabber_initiate_media(PurpleConnection *gc, const char *who, 
 		      PurpleMediaSessionType type)
 {
+#ifdef USE_VV
 	JabberStream *js = (JabberStream *) gc->proto_data;
 	JabberBuddy *jb;
 
@@ -2652,10 +2647,14 @@
 		return jabber_google_session_initiate(gc->proto_data, who, type);
 	else
 		return jingle_rtp_initiate_media(gc->proto_data, who, type);
+#else
+	return NULL;
+#endif
 }
 
 PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who)
 {
+#ifdef USE_VV
 	JabberStream *js = (JabberStream *) gc->proto_data;
 	JabberBuddy *jb;
 	PurpleMediaCaps caps = PURPLE_MEDIA_CAPS_NONE;
@@ -2696,10 +2695,11 @@
 		caps |= PURPLE_MEDIA_CAPS_AUDIO;
 
 	return caps;
+#else
+	return PURPLE_MEDIA_CAPS_NONE;
+#endif
 }
 
-#endif
-
 void jabber_register_commands(void)
 {
 	purple_cmd_register("config", "", PURPLE_CMD_P_PRPL,
--- a/libpurple/protocols/jabber/jabber.h	Sat Mar 21 07:53:22 2009 +0000
+++ b/libpurple/protocols/jabber/jabber.h	Sat Mar 21 09:07:06 2009 +0000
@@ -321,12 +321,9 @@
 gboolean jabber_offline_message(const PurpleBuddy *buddy);
 int jabber_prpl_send_raw(PurpleConnection *gc, const char *buf, int len);
 GList *jabber_actions(PurplePlugin *plugin, gpointer context);
+PurpleMedia *jabber_initiate_media(PurpleConnection *gc, const char *who,
+		PurpleMediaSessionType type);
+PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who);
 void jabber_register_commands(void);
 void jabber_init_plugin(PurplePlugin *plugin);
-
-#ifdef USE_VV
-PurpleMedia *jabber_initiate_media(PurpleConnection *gc, const char *who, PurpleMediaSessionType type);
-PurpleMediaCaps jabber_get_media_caps(PurpleConnection *gc, const char *who);
-#endif
-
 #endif /* _PURPLE_JABBER_H_ */
--- a/libpurple/protocols/jabber/libxmpp.c	Sat Mar 21 07:53:22 2009 +0000
+++ b/libpurple/protocols/jabber/libxmpp.c	Sat Mar 21 09:07:06 2009 +0000
@@ -119,13 +119,8 @@
 	jabber_attention_types,			/* attention_types */
 	sizeof(PurplePluginProtocolInfo),       /* struct_size */
 	NULL, /* get_account_text_table */
-#ifdef USE_VV
 	jabber_initiate_media,          /* initiate_media */
 	jabber_get_media_caps,                  /* get_media_caps */
-#else
-	NULL,					/* initiate_media */
-	NULL					/* can_do_media */
-#endif
 };
 
 static gboolean load_plugin(PurplePlugin *plugin)