pidgin.vv: a86fcbe0: Clean up usage of USE_VV in the XMPP pro...

maiku at soc.pidgin.im maiku at soc.pidgin.im
Sat Mar 21 05:15:54 EDT 2009


-----------------------------------------------------------------
Revision: a86fcbe0eae6c24d263a079855d1f1f0afeaa38b
Ancestor: 9ed2c540f1244c1cc0881a165c76d2886f073fab
Author: maiku at soc.pidgin.im
Date: 2009-03-21T09:07:06
Branch: im.pidgin.pidgin.vv
URL: http://d.pidgin.im/viewmtn/revision/info/a86fcbe0eae6c24d263a079855d1f1f0afeaa38b

Modified 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

ChangeLog: 

Clean up usage of USE_VV in the XMPP protocol.

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/google.c	cba9b2be74268aa3825bdb66016d353be40d6e8a
+++ libpurple/protocols/jabber/google.c	c8ab5dc9cd92f9dc043b1a442553d5e85c3ab45a
@@ -510,12 +510,10 @@ google_session_parse_iq(JabberStream *js
 		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 @@ jabber_google_session_parse(JabberStream
 	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)
============================================================
--- libpurple/protocols/jabber/iq.c	f47c301f9f8462103aaddd817af993499c99b27f
+++ libpurple/protocols/jabber/iq.c	7b7a8588db89a64475c7505b13eb9ea6d0f67fde
@@ -372,11 +372,13 @@ void jabber_iq_parse(JabberStream *js, x
 			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 @@ void jabber_iq_parse(JabberStream *js, x
 		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 @@ void jabber_iq_init(void)
 	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);
============================================================
--- libpurple/protocols/jabber/jabber.c	cd6c2b1adbba1ee7b0cb759c519a7565153c9089
+++ libpurple/protocols/jabber/jabber.c	b8767b9561f31518ad2debcf965a07497f0547d0
@@ -738,10 +738,7 @@ jabber_login(PurpleAccount *account)
 	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 @@ void jabber_close(PurpleConnection *gc)
 {
 	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 @@ gboolean jabber_offline_message(const Pu
 {
 	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 @@ jabber_initiate_media(PurpleConnection *
 		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,9 +2695,10 @@ PurpleMediaCaps jabber_get_media_caps(Pu
 		caps |= PURPLE_MEDIA_CAPS_AUDIO;
 
 	return caps;
-}
-
+#else
+	return PURPLE_MEDIA_CAPS_NONE;
 #endif
+}
 
 void jabber_register_commands(void)
 {
============================================================
--- libpurple/protocols/jabber/jabber.h	d1fa0647ae1763b6ff4279bcb718a24164223d77
+++ libpurple/protocols/jabber/jabber.h	44ec8a3a0282e934e5cabf49db110cf21d39c50c
@@ -321,12 +321,9 @@ GList *jabber_actions(PurplePlugin *plug
 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_ */
============================================================
--- libpurple/protocols/jabber/libxmpp.c	fa043b1f5afe35d48893e52f7eb9df685fd9a2e7
+++ libpurple/protocols/jabber/libxmpp.c	2acb3c9a476b3f4a9e04aba7a3b1cf14d475c43f
@@ -119,13 +119,8 @@ static PurplePluginProtocolInfo prpl_inf
 	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)


More information about the Commits mailing list