pidgin: 665e2d64: jabber: actually look at the correct des...

malu at pidgin.im malu at pidgin.im
Mon Sep 13 14:37:23 EDT 2010


----------------------------------------------------------------------
Revision: 665e2d641cdd2b6cca3bca378641f8345572146f
Parent:   38eaad68c9e65295acb7aa04cd59bb448f058b47
Author:   malu at pidgin.im
Date:     09/13/10 14:33:09
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/665e2d641cdd2b6cca3bca378641f8345572146f

Changelog: 

jabber: actually look at the correct description on an incoming Google session

Changes against parent 38eaad68c9e65295acb7aa04cd59bb448f058b47

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

-------------- next part --------------
============================================================
--- libpurple/protocols/jabber/google/google_session.c	8fd722f9810b000103287edad6815f0442354e1b
+++ libpurple/protocols/jabber/google/google_session.c	87cece8a91dda09544a855f5bfb472f3b162801a
@@ -60,6 +60,9 @@ google_session_destroy(GoogleSession *se
 	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 @@ jabber_google_relay_response_session_han
 	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 @@ jabber_google_relay_response_session_han
 		
 	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 @@ google_session_handle_initiate(JabberStr
 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 @@ google_session_handle_initiate(JabberStr
 		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;
============================================================
--- libpurple/protocols/jabber/google/google_session.h	442150502421974e97741778f24e2a856d48a676
+++ libpurple/protocols/jabber/google/google_session.h	6ed9576fae0508bf98c2f8813ec69393d593b048
@@ -42,6 +42,8 @@ typedef struct {
 	JabberStream *js;
 	char *remote_jid;
 	char *iq_id;
+	xmlnode *description;		/* store incoming description through
+	 								relay credential fetching */
 	gpointer session_data;
 } GoogleSession;
 


More information about the Commits mailing list