/soc/2013/ashmew2/filetransferY: 639f7314eaf6: Fixed minor issue...

Ashish Gupta ashmew2 at gmail.com
Sun Feb 2 16:14:39 EST 2014


Changeset: 639f7314eaf62a0ce5476845287e124c9df95fe4
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2014-02-03 02:32 +0530
Branch:	 default
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferY/rev/639f7314eaf6

Description:

Fixed minor issues such as whitespaces

diffstat:

 .hgignore                                          |   4 +-
 libpurple/protocols/jabber/disco.c                 |   4 +-
 libpurple/protocols/jabber/google/google_session.c |  22 ++------
 libpurple/protocols/jabber/google/google_session.h |  55 +++++++++++++--------
 libpurple/protocols/jabber/google/jingleinfo.c     |   1 +
 libpurple/protocols/jabber/google/relay.c          |  16 ------
 libpurple/protocols/jabber/google/relay.h          |   6 --
 libpurple/protocols/jabber/iq.c                    |   2 -
 libpurple/protocols/jabber/namespaces.h            |   2 -
 libpurple/protocols/jabber/parser.c                |   2 -
 libpurple/protocols/jabber/presence.c              |   7 +-
 libpurple/xfer.c                                   |   5 +-
 libpurple/xfer.h                                   |  46 ------------------
 libpurple/xmlnode.c                                |   1 -
 14 files changed, 52 insertions(+), 121 deletions(-)

diffs (truncated from 506 to 300 lines):

diff --git a/.hgignore b/.hgignore
--- a/.hgignore
+++ b/.hgignore
@@ -1,6 +1,7 @@
 syntax: glob
 .*.swp
 clang_output_*
+pidgin-*
 
 syntax: regexp
 (.*/)?TAGS$
@@ -119,7 +120,6 @@ po/notexist
 po/pidgin.pot
 po/stamp-it
 stamp-h1
+\#.*\#
 test-driver
 win32-install-dir(\.release)?
-\#.*\#
-test-driver
diff --git a/libpurple/protocols/jabber/disco.c b/libpurple/protocols/jabber/disco.c
--- a/libpurple/protocols/jabber/disco.c
+++ b/libpurple/protocols/jabber/disco.c
@@ -144,8 +144,8 @@ void jabber_disco_info_parse(JabberStrea
 			}
 		} else if (g_str_equal(node, CAPS0115_NODE "#" "share-v1")) {
 		  
-			xmlnode *feature = xmlnode_new_child(query, "feature");
-			xmlnode_set_attrib(feature, "var", NS_GOOGLE_SHARE);
+			PurpleXmlNode *feature = purple_xmlnode_new_child(query, "feature");
+			purple_xmlnode_set_attrib(feature, "var", NS_GOOGLE_SHARE);
 #ifdef USE_VV
 		} else if (g_str_equal(node, CAPS0115_NODE "#" "voice-v1")) {
 			/*
diff --git a/libpurple/protocols/jabber/google/google_session.c b/libpurple/protocols/jabber/google/google_session.c
--- a/libpurple/protocols/jabber/google/google_session.c
+++ b/libpurple/protocols/jabber/google/google_session.c
@@ -22,6 +22,7 @@
 #include "debug.h"
 #include "google_session.h"
 #include "relay.h"
+
 #include "jingle/jingle.h"
 #include <nice/agent.h>
 
@@ -32,10 +33,8 @@ typedef struct {
 	gboolean video;
 	GList *remote_audio_candidates; /* list of PurpleMediaCandidate */
 	GList *remote_video_candidates; /* list of PurpleMediaCandidate */
-	gboolean added_streams;		/* this indicates if the streams have 
-					 * been to media (ie. after getting
-					 * relay credentials 
-					 */
+	gboolean added_streams;		/* this indicates if the streams have been
+	 							   to media (ie. after getting relay credentials */
 } GoogleAVSessionData;
 
 static gboolean
@@ -244,9 +243,7 @@ google_session_ready(GoogleSession *sess
 		((GoogleAVSessionData *)session->session_data)->media;
 	gboolean video =
 		((GoogleAVSessionData *)session->session_data)->video;
-
 	gboolean share = session->share;		
-
 	if (purple_media_codecs_ready(media, NULL) &&
 			purple_media_candidates_prepared(media, NULL, NULL)) {
 		gchar *me = g_strdup_printf("%s@%s/%s",
@@ -283,7 +280,6 @@ google_session_ready(GoogleSession *sess
 		}
 		purple_xmlnode_insert_child(iq->node, sess);
 		desc = purple_xmlnode_new_child(sess, "description");
-
 		if (share)
 			purple_xmlnode_set_namespace(desc, NS_GOOGLE_SESSION_SHARE);				       
 		else if (video)
@@ -425,9 +421,7 @@ jabber_google_relay_response_session_ini
     const gchar *relay_ip, guint relay_udp, guint relay_tcp, guint relay_ssltcp,
     const gchar *relay_username, const gchar *relay_password)
 {
-	JabberStream *js = session->js;
-	
-	purple_debug_info("google_session", "Inside jabber_google_relay_response_initiate_cb!\n");
+	JabberStream *js = session->js;	
 
 	if(session->share) {		
 		GoogleXferSessionData *share_session =
@@ -575,7 +569,7 @@ jabber_google_session_initiate(JabberStr
 	}
 
 	/* we don't actually know yet wether it succeeded... maybe this is very
-	   wrong... */
+	 wrong... */
 	return TRUE;
 }
 
@@ -1123,11 +1117,9 @@ jabber_google_session_parse(JabberStream
 	iter = purple_media_manager_get_media_by_account(
 			purple_media_manager_get(),
 			purple_connection_get_account(js->gc));
-
 	for (; iter; iter = g_list_delete_link(iter, iter)) {
 		GoogleSession *gsession =
-			purple_media_get_prpl_data(iter->data);
-
+				purple_media_get_prpl_data(iter->data);
 		if (google_session_id_equal(&(gsession->id), &id)) {
 			session = gsession;
 			break;
@@ -1180,7 +1172,6 @@ jabber_google_session_parse(JabberStream
 	desc_node = xmlnode_get_child(session_node, "description");
 	if (!desc_node)
 		return;
-
 	session = g_new0(GoogleSession, 1);
 	session->id.id = g_strdup(id.id);
 	session->id.initiator = g_strdup(id.initiator);
@@ -1191,7 +1182,6 @@ jabber_google_session_parse(JabberStream
 
 	google_session_handle_initiate(js, session, session_node, iq_id);
 }
-
 #endif /* USE_VV */
 
 
diff --git a/libpurple/protocols/jabber/google/google_session.h b/libpurple/protocols/jabber/google/google_session.h
--- a/libpurple/protocols/jabber/google/google_session.h
+++ b/libpurple/protocols/jabber/google/google_session.h
@@ -93,39 +93,52 @@ typedef struct {
 	gpointer session_data;
 } GoogleSession;
 
-void cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint component_id,
-			  gchar *lfoundation, gchar *rfoundation, gpointer user_data);
-void cb_nice_component_state_changed(NiceAgent *agent,guint stream_id, guint component_id,
-				     guint state, gpointer user_data);
-void cb_nice_component_writable(NiceAgent *agent, guint stream_id, guint component_id,
-				gpointer user_data);
+void 
+cb_new_selected_pair(NiceAgent *agent, guint stream_id, guint component_id,
+		     gchar *lfoundation, gchar *rfoundation, gpointer user_data);
 
-void gtalk_xfer_handle_initiate(JabberStream *js, 
-				GoogleSession *session, 
-				xmlnode *sess, 
-				const char *iq_id);
+void 
+cb_nice_component_state_changed(NiceAgent *agent,guint stream_id, guint component_id,
+				guint state, gpointer user_data);
 
-void gtalk_xfer_handle_candidates(JabberStream *js, GoogleSession *session, xmlnode *sess, const char *iq_id);
-void gtalk_xfer_handle_info(JabberStream  *js, GoogleSession *session, xmlnode *sess, const char *iq_id);
-void gtalk_xfer_handle_accept(JabberStream *js, GoogleSession *session, const char *iq_id);
-void gtalk_xfer_handle_reject(JabberStream *js, GoogleSession *session, const char *iq_id);
-gint gtalk_xfer_init_agent(GoogleSession *session); 
+void 
+cb_nice_component_writable(NiceAgent *agent, guint stream_id, guint component_id,
+			   gpointer user_data);
 
-void jabber_google_relay_response_session_initiate_cb(GoogleSession *session,
-						      const gchar *relay_ip, guint relay_udp, guint relay_tcp, guint relay_ssltcp,
-						      const gchar *relay_username, const gchar *relay_password);
+void 
+gtalk_xfer_handle_initiate(JabberStream *js, GoogleSession *session, xmlnode *sess, 
+			   const char *iq_id);
+
+void 
+gtalk_xfer_handle_candidates(JabberStream *js, GoogleSession *session, xmlnode *sess, const char *iq_id);
+void 
+gtalk_xfer_handle_info(JabberStream  *js, GoogleSession *session, xmlnode *sess, const char *iq_id);
+void 
+gtalk_xfer_handle_accept(JabberStream *js, GoogleSession *session, const char *iq_id);
+void 
+gtalk_xfer_handle_reject(JabberStream *js, GoogleSession *session, const char *iq_id);
+gint 
+gtalk_xfer_init_agent(GoogleSession *session); 
+
+void 
+jabber_google_relay_response_session_initiate_cb(GoogleSession *session, const gchar *relay_ip,
+						 guint relay_udp, guint relay_tcp, guint relay_ssltcp,
+						 const gchar *relay_username, const gchar *relay_password);
 xmlnode *
 google_session_create_xmlnode(GoogleSession *session, const char *type);
+
 void
 gtalk_xfer_send(PurpleConnection *gc, const char *who, const char *file);
 
-void cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpointer user_data);
+void 
+cb_candidate_gathering_done(NiceAgent *agent, guint stream_id, gpointer user_data);
 
 gboolean jabber_google_session_initiate(JabberStream *js, const gchar *who,
-    PurpleMediaSessionType type);
+					PurpleMediaSessionType type);
 
 void jabber_google_session_parse(JabberStream *js, const char *from,
-    JabberIqType type, const char *iq, PurpleXmlNode *session);
+				 JabberIqType type, const char *iq, 
+				 PurpleXmlNode *session);
 
 void google_session_destroy(GoogleSession *session);
 
diff --git a/libpurple/protocols/jabber/google/jingleinfo.c b/libpurple/protocols/jabber/google/jingleinfo.c
--- a/libpurple/protocols/jabber/google/jingleinfo.c
+++ b/libpurple/protocols/jabber/google/jingleinfo.c
@@ -58,6 +58,7 @@ jabber_google_stun_lookup_cb(GSList *hos
 
 		purple_debug_info("jabber", "set Google STUN IP/port address: "
 		                  "%s:%d\n", dst, port);
+
 		/* unmark ongoing query */
 		js->stun_query = NULL;
 	}
diff --git a/libpurple/protocols/jabber/google/relay.c b/libpurple/protocols/jabber/google/relay.c
--- a/libpurple/protocols/jabber/google/relay.c
+++ b/libpurple/protocols/jabber/google/relay.c
@@ -62,28 +62,12 @@ jabber_google_relay_parse_response(const
 }
 
 static void
-jabber_google_relay_remove_url_data(JabberStream *js,
-	PurpleUtilFetchUrlData *url_data)
-{
-	GList *iter = js->google_relay_requests;
-
-	while (iter) {
-		if (iter->data == url_data) {
-			js->google_relay_requests =
-				g_list_delete_link(js->google_relay_requests, iter);
-			break;
-		}
-	}
-}
-
-static void
 jabber_google_relay_fetch_cb(PurpleHttpConnection *http_conn,
 	PurpleHttpResponse *response, gpointer user_data)
 {
 	JabberGoogleRelayCallbackData *data =
 		(JabberGoogleRelayCallbackData *) user_data;
 	GoogleSession *session = data->session;
-	JabberStream *js = session->js;
 	JabberGoogleRelayCallback *cb = data->cb;
 	gchar *relay_ip = NULL;
 	guint relay_udp = 0;
diff --git a/libpurple/protocols/jabber/google/relay.h b/libpurple/protocols/jabber/google/relay.h
--- a/libpurple/protocols/jabber/google/relay.h
+++ b/libpurple/protocols/jabber/google/relay.h
@@ -30,10 +30,4 @@ typedef void (JabberGoogleRelayCallback)
 void jabber_google_do_relay_request(JabberStream *js, GoogleSession *session,
 	JabberGoogleRelayCallback cb);
 
-
-typedef struct {
-	GoogleSession *session;
-	JabberGoogleRelayCallback *cb;
-} JabberGoogleRelayCallbackData;
-
 #endif /* JABBER_GOOGLE_RELAY */
diff --git a/libpurple/protocols/jabber/iq.c b/libpurple/protocols/jabber/iq.c
--- a/libpurple/protocols/jabber/iq.c
+++ b/libpurple/protocols/jabber/iq.c
@@ -572,10 +572,8 @@ void jabber_iq_init(void)
 			jabber_roster_parse);
 	jabber_iq_register_handler("query", "jabber:iq:version",
 			jabber_iq_version_parse);
-
 	jabber_iq_register_handler("session", NS_GOOGLE_SESSION,
 		jabber_google_session_parse);
-
 	jabber_iq_register_handler("block", NS_SIMPLE_BLOCKING, jabber_blocklist_parse_push);
 	jabber_iq_register_handler("unblock", NS_SIMPLE_BLOCKING, jabber_blocklist_parse_push);
 	jabber_iq_register_handler("time", NS_ENTITY_TIME, jabber_time_parse);
diff --git a/libpurple/protocols/jabber/namespaces.h b/libpurple/protocols/jabber/namespaces.h
--- a/libpurple/protocols/jabber/namespaces.h
+++ b/libpurple/protocols/jabber/namespaces.h
@@ -112,8 +112,6 @@
 #define NS_GOOGLE_SESSION_SHARE "http://www.google.com/session/share"
 #define NS_GOOGLE_TRANSPORT_P2P "http://www.google.com/transport/p2p"
 
-#define NS_GOOGLE_TRANSPORT_P2P "http://www.google.com/transport/p2p"
-
 /* Apple extension(s) */
 #define NS_APPLE_IDLE "http://www.apple.com/xmpp/idle"
 
diff --git a/libpurple/protocols/jabber/parser.c b/libpurple/protocols/jabber/parser.c
--- a/libpurple/protocols/jabber/parser.c
+++ b/libpurple/protocols/jabber/parser.c
@@ -272,11 +272,9 @@ void jabber_parser_process(JabberStream 
 	int ret;
 
 	if (js->context == NULL) {
-	  
 		/* libxml inconsistently starts parsing on creating the
 		 * parser, so do a ParseChunk right afterwards to force it. */
 		js->context = xmlCreatePushParserCtxt(&jabber_parser_libxml, js, buf, len, NULL);
-
 		xmlParseChunk(js->context, "", 0, 0);
 	} else if ((ret = xmlParseChunk(js->context, buf, len, 0)) != XML_ERR_OK) {
 		xmlError *err = xmlCtxtGetLastError(js->context);



More information about the Commits mailing list