/soc/2013/ashmew2/filetransferX: 0bb50b5cb6d3: Modified GoogleAV...

Ashish Gupta ashmew2 at gmail.com
Sun Aug 4 09:21:45 EDT 2013


Changeset: 0bb50b5cb6d34dedeee4f2195ef8833c6db8c80b
Author:	 Ashish Gupta <ashmew2 at gmail.com>
Date:	 2013-08-04 18:51 +0530
Branch:	 filetransferX
URL: https://hg.pidgin.im/soc/2013/ashmew2/filetransferX/rev/0bb50b5cb6d3

Description:

Modified GoogleAVSession struct

diffstat:

 libpurple/protocols/jabber/google/google_session.c |  28 +++++++++++-----------
 1 files changed, 14 insertions(+), 14 deletions(-)

diffs (82 lines):

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
@@ -28,9 +28,19 @@
 #ifdef USE_VV
 
 typedef struct {
+	gchar *filename;
+	guint64 filesize;
+	gchar *preview_url;
+	gchar *source_url;
+	/*Needs to have a manifest Entry for Folder Sharing*/
+	GList *remote_share_candidates; /* list of PurpleMediaCandidate */
+} GoogleXferSessionData; 
+
+typedef struct {
 	PurpleMedia *media;
 	gboolean video;
 	gboolean share;
+	GoogleXferSessionData share_session;
 	GList *remote_audio_candidates; /* list of PurpleMediaCandidate */
 	GList *remote_video_candidates; /* list of PurpleMediaCandidate */
 	gboolean added_streams;		/* this indicates if the streams have been
@@ -42,12 +52,6 @@ typedef struct {
   } GoogleShareManifest;
 */
 
-typedef struct {
-	gchar *filename;
-	guint64 filesize;
-	gchar *preview_url;
-	gchar *source_url;
-} GoogleXferSessionData; 
 
 static gboolean
 google_session_id_equal(gconstpointer a, gconstpointer b)
@@ -638,7 +642,6 @@ google_session_handle_initiate(JabberStr
 		xmlnode *description = xmlnode_get_child(sess, "description");
 		xmlnode *manifest,*file,*filename,*protocol,*http,*url_source_path,*url_preview_path,*transport;
 		char *filesize;
-		GoogleXferSessionData *IncomingXfer = g_new0(GoogleXferSessionData, 1);
 		JabberIq *result_iq, *set_iq;
 		char *responsetxt;
 		int responsetxtlen;
@@ -661,11 +664,10 @@ google_session_handle_initiate(JabberStr
 					filename = xmlnode_get_child(file, "name");
 					filesize = xmlnode_get_attrib(file, "size");
 					purple_debug_info("google_session", "File size : %s",filesize);
-					IncomingXfer->filesize = g_ascii_strtoull((gchar *)xmlnode_get_attrib(file, "size"),NULL,10);
-
+					session_data->share_session->filesize = g_ascii_strtoull((gchar *)xmlnode_get_attrib(file, "size"),NULL,10);
 					if( filename ) {
 						purple_debug_info("google_session", "Filename : %s",xmlnode_get_data(filename));
-						IncomingXfer->filename = xmlnode_get_data(filename);
+						session_data->share_session->filename = xmlnode_get_data(filename);
 					}
 					else
 						purple_debug_info("google_session", "Filename is NULL");
@@ -680,12 +682,12 @@ google_session_handle_initiate(JabberStr
 					url_source_path = xmlnode_get_child(http, "url");
 					if( url_source_path ) {
 						purple_debug_info("google_session", "url_source_path is not NULL. Name : %s",xmlnode_get_data(url_source_path));
-						IncomingXfer->source_url = xmlnode_get_data(url_source_path);
+						session_data->share_session->source_url = xmlnode_get_data(url_source_path);
 					}
 					url_preview_path = xmlnode_get_next_twin(url_source_path);
 					if(url_preview_path) {
 						purple_debug_info("google_session", "url_source_preview is not NULL. Data : %s",xmlnode_get_data(url_preview_path));
-						IncomingXfer->preview_url = xmlnode_get_data(url_preview_path);
+						session_data->share_session->preview_url = xmlnode_get_data(url_preview_path);
 					}
 				}
 			}
@@ -717,8 +719,6 @@ FT XML:
 (23:33:01) jabber: Recv (ssl)(238): <iq to="doondoon1234 at gmail.com/B1D48535" type="set" id="152" from="ashmew2 at gmail.com/Talk.v104536A73D2"><session type="terminate" id="1800989809" initiator="ashmew2 at gmail.com/Talk.v104536A73D2" xmlns="http://www.google.com/session"/></iq>
 		************************************/
 		purple_debug_info("google_session", "We have received a file request.\n");
-		purple_debug_info("google_session", "me = %s. Length : %d\n",me, strlen(temp));
-		purple_debug_info("google_session", "Parameter : iq_id = %s.\n", iq_id);
 
 		purple_debug_info("google_session", "Sending a file request in return\n");
 		jabber_send_raw(js,temp,strlen(temp));



More information about the Commits mailing list