changeset 30546:1d55c7e1006e

jabber: actually look at the correct description on an incoming Google session
author Marcus Lundblad <ml@update.uu.se>
date Mon, 13 Sep 2010 18:33:09 +0000
parents 277451b94288
children 8742041c5883 b9dc45392feb
files libpurple/protocols/jabber/google/google_session.c libpurple/protocols/jabber/google/google_session.h
diffstat 2 files changed, 8 insertions(+), 5 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/jabber/google/google_session.c	Mon Sep 13 09:22:59 2010 +0000
+++ b/libpurple/protocols/jabber/google/google_session.c	Mon Sep 13 18:33:09 2010 +0000
@@ -60,6 +60,9 @@
 	if (session_data->remote_video_candidates)
 		purple_media_candidate_list_free(session_data->remote_video_candidates);
 
+	if (session->description)
+		xmlnode_free(session->description);
+	
 	g_free(session->session_data);
 	g_free(session);
 }
@@ -453,7 +456,6 @@
 	guint num_params;
 	JabberStream *js = session->js;
 	xmlnode *codec_element;
-	xmlnode *desc_element;
 	const gchar *xmlns;
 	PurpleMediaCodec *codec;
 	GList *video_codecs = NULL;
@@ -498,7 +500,7 @@
 		
 	g_free(params);
 
-	for (codec_element = xmlnode_get_child(desc_element, "payload-type");
+	for (codec_element = xmlnode_get_child(session->description, "payload-type");
 	     codec_element; codec_element = codec_element->next) {
 		const char *id, *encoding_name,  *clock_rate,
 				*width, *height, *framerate;
@@ -557,7 +559,6 @@
 static gboolean
 google_session_handle_initiate(JabberStream *js, GoogleSession *session, xmlnode *sess, const char *iq_id)
 {
-	xmlnode *desc_element;
 	const gchar *xmlns;
 	GoogleAVSessionData *session_data =
 		(GoogleAVSessionData *) session->session_data;
@@ -567,8 +568,8 @@
 		return FALSE;
 	}
 
-	desc_element = xmlnode_get_child(sess, "description");
-	xmlns = xmlnode_get_namespace(desc_element);
+	session->description = xmlnode_copy(xmlnode_get_child(sess, "description"));
+	xmlns = xmlnode_get_namespace(session->description);
 
 	if (purple_strequal(xmlns, NS_GOOGLE_SESSION_PHONE))
 		session_data->video = FALSE;
--- a/libpurple/protocols/jabber/google/google_session.h	Mon Sep 13 09:22:59 2010 +0000
+++ b/libpurple/protocols/jabber/google/google_session.h	Mon Sep 13 18:33:09 2010 +0000
@@ -42,6 +42,8 @@
 	JabberStream *js;
 	char *remote_jid;
 	char *iq_id;
+	xmlnode *description;		/* store incoming description through
+	 								relay credential fetching */
 	gpointer session_data;
 } GoogleSession;