pidgin: b2c53d76: Convert the mxit prpl to use the new API...

andrew.victor at mxit.com andrew.victor at mxit.com
Fri Aug 26 17:31:08 EDT 2011


----------------------------------------------------------------------
Revision: b2c53d769ce87b56feb15d90826152e4855960f1
Parent:   fa03cadccc7b619a5019c6f86a917302e14542f5
Author:   andrew.victor at mxit.com
Date:     08/26/11 14:10:05
Branch:   im.pidgin.pidgin
URL: http://d.pidgin.im/viewmtn/revision/info/b2c53d769ce87b56feb15d90826152e4855960f1

Changelog: 

Convert the mxit prpl to use the new API.


Changes against parent fa03cadccc7b619a5019c6f86a917302e14542f5

  patched  libpurple/protocols/mxit/filexfer.c

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/filexfer.c	61b9bf019d2bfa400cfe73d214710b9b52f680c5
+++ libpurple/protocols/mxit/filexfer.c	87b4419328dda6cb4b21f92c017fd3c3c32441c5
@@ -97,11 +97,11 @@ static void mxit_xfer_free( PurpleXfer* 
  */
 static void mxit_xfer_free( PurpleXfer* xfer )
 {
-	struct mxitxfer*	mx		= (struct mxitxfer*) xfer->data;;
+	struct mxitxfer*	mx	= purple_xfer_get_protocol_data( xfer );
 
 	if ( mx ) {
+		purple_xfer_set_protocol_data( xfer, NULL );
 		g_free( mx );
-		xfer->data = NULL;
 	}
 }
 
@@ -117,7 +117,7 @@ static void mxit_xfer_init( PurpleXfer* 
  */
 static void mxit_xfer_init( PurpleXfer* xfer )
 {
-	struct mxitxfer*	mx	= (struct mxitxfer*) xfer->data;
+	struct mxitxfer*	mx	= purple_xfer_get_protocol_data( xfer );
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_xfer_init\n" );
 
@@ -218,7 +218,7 @@ static gssize mxit_xfer_write( const guc
  */
 static gssize mxit_xfer_write( const guchar* buffer, size_t size, PurpleXfer* xfer )
 {
-	struct mxitxfer*	mx	= (struct mxitxfer*) xfer->data;
+	struct mxitxfer*	mx	= purple_xfer_get_protocol_data( xfer );
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_xfer_write\n" );
 
@@ -248,7 +248,7 @@ static void mxit_xfer_request_denied( Pu
  */
 static void mxit_xfer_request_denied( PurpleXfer* xfer )
 {
-	struct mxitxfer*	mx		= (struct mxitxfer*) xfer->data;
+	struct mxitxfer*	mx		= purple_xfer_get_protocol_data( xfer );
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_xfer_request_denied\n" );
 
@@ -308,7 +308,7 @@ PurpleXfer* mxit_xfer_new( PurpleConnect
 	/* create file info and attach it to the file transfer */
 	mx = g_new0( struct mxitxfer, 1 );
 	mx->session = session;
-	xfer->data = mx;
+	purple_xfer_set_protocol_data( xfer, mx );
 
 	/* configure callbacks (reference: "libpurple/ft.h") */
 	purple_xfer_set_init_fnc( xfer, mxit_xfer_init );
@@ -365,7 +365,7 @@ void mxit_xfer_rx_offer( struct MXitSess
 		mx = g_new0( struct mxitxfer, 1 );
 		mx->session = session;
 		memcpy( mx->fileid, fileid, MXIT_CHUNK_FILEID_LEN );
-		xfer->data = mx;
+		purple_xfer_set_protocol_data( xfer, mx );
 
 		purple_xfer_set_filename( xfer, filename );
 		if( filesize > 0 )
@@ -400,7 +400,7 @@ static PurpleXfer* find_mxit_xfer( struc
 
 		if ( purple_xfer_get_account( xfer ) == session->acc ) {
 			/* transfer is associated with this MXit account */
-			struct mxitxfer* mx	= xfer->data;
+			struct mxitxfer* mx	= purple_xfer_get_protocol_data( xfer );
 
 			/* does the fileid match? */
 			if ( ( mx ) && ( memcmp( mx->fileid, fileid, MXIT_CHUNK_FILEID_LEN ) == 0 ) )
@@ -434,7 +434,7 @@ void mxit_xfer_rx_file( struct MXitSessi
 	/* find the file-transfer object */
 	xfer = find_mxit_xfer( session, fileid );
 	if ( xfer ) {
-		mx = xfer->data;
+		mx = purple_xfer_get_protocol_data( xfer );
 
 		/* this is the transfer we have been looking for */
 		purple_xfer_ref( xfer );


More information about the Commits mailing list