cpw.malu.xmpp.google_ft: 6edb7e47: fix after merge, removed #ifdef USE_VV f...

malu at pidgin.im malu at pidgin.im
Mon Sep 13 14:56:32 EDT 2010


----------------------------------------------------------------------
Revision: 6edb7e47b669580c3b6b3b9d7881201f2f5d759c
Parent:   db59cf5117aeb8671c33f9998231ad16252f0c92
Author:   malu at pidgin.im
Date:     09/13/10 14:50:36
Branch:   im.pidgin.cpw.malu.xmpp.google_ft
URL: http://d.pidgin.im/viewmtn/revision/info/6edb7e47b669580c3b6b3b9d7881201f2f5d759c

Changelog: 

fix after merge, removed #ifdef USE_VV from google session base stuff, will need to sort that out later to conditionally include the right stuff...

Changes against parent db59cf5117aeb8671c33f9998231ad16252f0c92

  patched  libpurple/protocols/jabber/google/google_session.c
  patched  libpurple/protocols/jabber/google/google_share.c

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/google/google_session.c	ad8bd53627909b053023788de9df0745774aef05
+++ libpurple/protocols/jabber/google/google_session.c	6ee8d511974546d3c9ca1410683cfff930347200
@@ -25,38 +25,21 @@
 #include "google_share.h"
 #include "relay.h"
 
+static GList *google_sessions = NULL;
 
-#ifdef USE_VV
-
-typedef struct {
-	PurpleMedia *media;
-	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 */
-} GoogleAVSessionData;
-
-static gboolean
-google_session_id_equal(gconstpointer a, gconstpointer b)
-{
-	GoogleSessionId *c = (GoogleSessionId*)a;
-	GoogleSessionId *d = (GoogleSessionId*)b;
-
-	return !strcmp(c->id, d->id) && !strcmp(c->initiator, d->initiator);
-}
-
 static void
 google_session_destroy(GoogleSession *session)
 {
-	GoogleAVSessionData *session_data =
-		(GoogleAVSessionData *) session->session_data;
 	g_free(session->id.id);
 	g_free(session->id.initiator);
 	g_free(session->remote_jid);
 
-#ifdef USE_VV
+	if (session->description)
+		xmlnode_free(session->description);
 
+	g_free(session);
+}
+
 xmlnode *
 google_session_create_xmlnode(GoogleSession *session, const char *type)
 {
@@ -74,7 +57,15 @@ google_session_handle_initiate(JabberStr
 {
 	xmlnode *desc_element = xmlnode_get_child(sess, "description");
 	const gchar *xmlns = xmlnode_get_namespace(desc_element);
+
+	if (!desc_element) {
+		purple_debug_error("google",
+			"received session initiate without description\n");
+		return FALSE;
+	}
 	
+	session->description = xmlnode_copy(desc_element);
+	
 	if (session->state != UNINIT) {
 		purple_debug_error("jabber", "Received initiate for active session.\n");
 		return FALSE;
@@ -149,10 +140,6 @@ jabber_google_session_parse(JabberStream
 	const gchar *id;
 	const gchar *initiator;
 
-	xmlnode *desc_node;
-
-	GList *iter = NULL;
-
 	if (type != JABBER_IQ_SET)
 		return;
 
@@ -174,9 +161,7 @@ jabber_google_session_parse(JabberStream
 	/* If the session doesn't exist, this has to be an initiate message */
 	if (strcmp(xmlnode_get_attrib(session_node, "type"), "initiate"))
 		return;
-	desc_node = xmlnode_get_child(session_node, "description");
-	if (!desc_node)
-		return;
+
 	session = g_new0(GoogleSession, 1);
 	session->id.id = g_strdup(id);
 	session->id.initiator = g_strdup(initiator);
@@ -188,7 +173,6 @@ jabber_google_session_parse(JabberStream
 	
 	google_session_handle_initiate(js, session, session_node, iq_id);
 }
-#endif /* USE_VV */
 
 void
 jabber_google_session_register(GoogleSession *session)
============================================================
--- libpurple/protocols/jabber/google/google_share.c	5ec92fb74eb96c30c11b0aa295867121003f7e4f
+++ libpurple/protocols/jabber/google/google_share.c	386c492e5dcde31f598a9f3b8dfa8a12d23d9fe9
@@ -34,7 +34,6 @@ typedef struct {
 	guint stream_id;
 	GList *remote_candidates; /* list of PurpleMediaCandidate */
 	gboolean got_relay;		/* this indicates if gotten relay credentials */
-	xmlnode *description;
 } GoogleShareSessionData;
 
 static void
@@ -134,7 +133,7 @@ google_share_init(PurpleXfer *xfer)
 	xmlnode_set_attrib(iq->node, "to", session->remote_jid);
 	xmlnode_set_attrib(iq->node, "from", me);
 	xmlnode_insert_child(iq->node, sess);
-	xmlnode_insert_child(sess, xmlnode_copy(session_data->description));
+	xmlnode_insert_child(sess, xmlnode_copy(session->description));
 	jabber_iq_send(iq);
 	
 	/* start agent */
@@ -222,7 +221,6 @@ void google_share_handle_initiate(Jabber
 	guint size = atoi(xmlnode_get_attrib(file, "size"));
 	gchar *name =
 		xmlnode_get_data(xmlnode_get_child(file, "name"));
-	session_data->description = xmlnode_copy(description);
 	
 	purple_debug_info("google", "got file transfer offer\n");
 	session_data->xfer =


More information about the Commits mailing list