gobjectification: ce595caf: And so does MXit...

qulogic at pidgin.im qulogic at pidgin.im
Wed Jun 9 01:31:14 EDT 2010


-----------------------------------------------------------------
Revision: ce595caf8d9736f7f57dbe38da709aae9c4ca775
Ancestor: aedb69cf86b7bf67e60413986545d3fe7d05e21f
Author: qulogic at pidgin.im
Date: 2010-06-09T02:07:56
Branch: im.pidgin.gobjectification
URL: http://d.pidgin.im/viewmtn/revision/info/ce595caf8d9736f7f57dbe38da709aae9c4ca775

Modified files:
        libpurple/protocols/mxit/actions.c
        libpurple/protocols/mxit/cipher.c
        libpurple/protocols/mxit/filexfer.c
        libpurple/protocols/mxit/login.c
        libpurple/protocols/mxit/multimx.c
        libpurple/protocols/mxit/mxit.c
        libpurple/protocols/mxit/protocol.c
        libpurple/protocols/mxit/roster.c
        libpurple/protocols/mxit/splashscreen.c

ChangeLog: 

And so does MXit...

-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/actions.c	09a1faf94e3d8faca80b46b142ea0a1c91f2b36e
+++ libpurple/protocols/mxit/actions.c	935878cb43843cf834b6fd52f84661c0c78c1d97
@@ -43,7 +43,7 @@ static void mxit_cb_set_profile( PurpleC
  */
 static void mxit_cb_set_profile( PurpleConnection* gc, PurpleRequestFields* fields )
 {
-	struct MXitSession*		session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleRequestField*		field	= NULL;
 	const char*				pin		= NULL;
 	const char*				pin2	= NULL;
@@ -205,12 +205,13 @@ static void mxit_cb_action_profile( Purp
 static void mxit_cb_action_profile( PurplePluginAction* action )
 {
 	PurpleConnection*			gc		= (PurpleConnection*) action->context;
-	struct MXitSession*			session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*			session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	struct MXitProfile*			profile	= session->profile;
 
 	PurpleRequestFields*		fields	= NULL;
 	PurpleRequestFieldGroup*	group	= NULL;
 	PurpleRequestField*			field	= NULL;
+	const char*					password;
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_cb_action_profile\n" );
 
@@ -233,10 +234,11 @@ static void mxit_cb_action_profile( Purp
 	}
 
 	/* pin */
-	field = purple_request_field_string_new( "pin", _( "PIN" ), session->acc->password, FALSE );
+	password = purple_account_get_password( session->acc );
+	field = purple_request_field_string_new( "pin", _( "PIN" ), password, FALSE );
 	purple_request_field_string_set_masked( field, TRUE );
 	purple_request_field_group_add_field( group, field );
-	field = purple_request_field_string_new( "pin2", _( "Verify PIN" ), session->acc->password, FALSE );
+	field = purple_request_field_string_new( "pin2", _( "Verify PIN" ), password, FALSE );
 	purple_request_field_string_set_masked( field, TRUE );
 	purple_request_field_group_add_field( group, field );
 
@@ -292,7 +294,7 @@ static void mxit_cb_action_splash( Purpl
 static void mxit_cb_action_splash( PurplePluginAction* action )
 {
 	PurpleConnection*		gc		= (PurpleConnection*) action->context;
-	struct MXitSession*		session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 
 	if ( splash_current( session ) != NULL )
 		splash_display( session );
============================================================
--- libpurple/protocols/mxit/cipher.c	8a25e2dc92f45444edd1d4e1696e5124ce97c878
+++ libpurple/protocols/mxit/cipher.c	d741e00dc76ef8b2b2ed474794d0fefb279e45da
@@ -90,7 +90,7 @@ char* mxit_encrypt_password( struct MXit
 
 	/* build the custom data to be encrypted */
 	strcpy( pass, SECRET_HEADER );
-	strcat( pass, session->acc->password );
+	strcat( pass, purple_account_get_password( session->acc ) );
 
 	/* pad the secret data */
 	blocks = pad_secret_data( pass );
============================================================
--- libpurple/protocols/mxit/filexfer.c	50e87d30c7fb89e91dc5cb5cd7df57457a9cf26b
+++ libpurple/protocols/mxit/filexfer.c	b3c9989ca971e20773a7118ae01cfa21fabee5ab
@@ -295,7 +295,7 @@ PurpleXfer* mxit_xfer_new( PurpleConnect
  */
 PurpleXfer* mxit_xfer_new( PurpleConnection* gc, const char* who )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleXfer*			xfer	= NULL;
 	struct mxitxfer*	mx		= NULL;
 
============================================================
--- libpurple/protocols/mxit/login.c	69634f73e44d7cd8202d919b719b3dfa0c8e15ab
+++ libpurple/protocols/mxit/login.c	1673cc30f645b7a420576aabeb7b84a231a608c9
@@ -51,13 +51,15 @@ static struct MXitSession* mxit_create_o
 {
 	struct MXitSession*	session		= NULL;
 	PurpleConnection*	con			= NULL;
+	const char*			username	= NULL;
 
 	/* currently the wapsite does not handle a '+' in front of the username (mxitid) so we just strip it */
-	if ( account->username[0] == '+' ) {
+	username = purple_account_get_username( account );
+	if ( username[0] == '+' ) {
 		char*		fixed;
 
 		/* cut off the '+' */
-		fixed = g_strdup( &account->username[1] );
+		fixed = g_strdup( &username[1] );
 		purple_account_set_username( account, fixed );
 		g_free( fixed );
 	}
@@ -66,8 +68,8 @@ static struct MXitSession* mxit_create_o
 
 	/* configure the connection (reference: "libpurple/connection.h") */
 	con = purple_account_get_connection( account );
-	con->proto_data = session;
-	con->flags |= PURPLE_CONNECTION_NO_BGCOLOR | PURPLE_CONNECTION_NO_URLDESC | PURPLE_CONNECTION_HTML | PURPLE_CONNECTION_SUPPORT_MOODS;
+	purple_object_set_protocol_data( PURPLE_OBJECT( con ), session );
+	purple_connection_turn_on_flags ( con, PURPLE_CONNECTION_FLAGS_NO_BGCOLOR | PURPLE_CONNECTION_FLAGS_NO_URLDESC | PURPLE_CONNECTION_FLAGS_HTML | PURPLE_CONNECTION_FLAGS_SUPPORT_MOODS );
 	session->con = con;
 
 	/* add account */
@@ -172,7 +174,7 @@ static void mxit_cb_connect( gpointer us
 	session->fd = source;
 
 	/* start listening on the open connection for messages from the server (reference: "libpurple/eventloop.h") */
-	session->con->inpa = purple_input_add( session->fd, PURPLE_INPUT_READ, mxit_cb_rx, session );
+	g_object_set( G_OBJECT( session->con ), "inpa", purple_input_add( session->fd, PURPLE_INPUT_READ, mxit_cb_rx, session ), NULL );
 
 	mxit_connected( session );
 }
@@ -220,7 +222,7 @@ static void mxit_cb_register_ok( PurpleC
  */
 static void mxit_cb_register_ok( PurpleConnection *gc, PurpleRequestFields *fields )
 {
-	struct MXitSession*		session		= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session		= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	struct MXitProfile*		profile		= session->profile;
 	const char*				str;
 	const char*				pin;
@@ -302,7 +304,7 @@ static void mxit_cb_register_cancel( Pur
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_cb_register_cancel\n" );
 
 	/* disconnect */
-	purple_account_disconnect( gc->account );
+	purple_account_disconnect( purple_connection_get_account( gc ) );
 }
 
 
@@ -506,7 +508,7 @@ static void mxit_cb_captcha_ok( PurpleCo
  */
 static void mxit_cb_captcha_ok( PurpleConnection* gc, PurpleRequestFields* fields )
 {
-	struct MXitSession*		session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleUtilFetchUrlData*	url_data;
 	PurpleRequestField*		field;
 	const char*				captcha_resp;
@@ -547,7 +549,7 @@ static void mxit_cb_captcha_ok( PurpleCo
 	state = purple_account_get_int( session->acc, MXIT_CONFIG_STATE, MXIT_STATE_LOGIN );
 
 	url = g_strdup_printf( "%s?type=getpid&sessionid=%s&login=%s&ver=%s&clientid=%s&cat=%s&chalresp=%s&cc=%s&loc=%s&path=%i&brand=%s&model=%s&h=%i&w=%i&ts=%li",
-			session->logindata->wapserver, session->logindata->sessionid, purple_url_encode( session->acc->username ), MXIT_CP_RELEASE, MXIT_CLIENT_ID, MXIT_CP_ARCH,
+			session->logindata->wapserver, session->logindata->sessionid, purple_url_encode( purple_account_get_username( session->acc ) ), MXIT_CP_RELEASE, MXIT_CLIENT_ID, MXIT_CP_ARCH,
 			captcha_resp, session->logindata->cc, session->logindata->locale, ( state == MXIT_STATE_REGISTER1 ) ? 0 : 1, MXIT_CP_PLATFORM, MXIT_CP_OS,
 			MXIT_CAPTCHA_HEIGHT, MXIT_CAPTCHA_WIDTH, time( NULL ) );
 	url_data = purple_util_fetch_url_request( url, TRUE, MXIT_HTTP_USERAGENT, TRUE, NULL, FALSE, mxit_cb_clientinfo2, session );
@@ -570,7 +572,7 @@ static void mxit_cb_captcha_cancel( Purp
  */
 static void mxit_cb_captcha_cancel( PurpleConnection* gc, PurpleRequestFields* fields )
 {
-	struct MXitSession*		session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 
 	/* free up the login resources */
 	free_logindata( session->logindata );
============================================================
--- libpurple/protocols/mxit/multimx.c	8055289b53d1ae927067e5313e7c251a03449653
+++ libpurple/protocols/mxit/multimx.c	baf4c2831b7b9f85408095e53bb874260a2bcd72
@@ -470,7 +470,7 @@ void mxit_chat_join(PurpleConnection *gc
  */
 void mxit_chat_join(PurpleConnection *gc, GHashTable *components)
 {
-	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
+	struct MXitSession* session = (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	const char* roomname = NULL;
 	struct multimx* multimx = NULL;
 
@@ -512,7 +512,7 @@ void mxit_chat_reject(PurpleConnection *
  */
 void mxit_chat_reject(PurpleConnection *gc, GHashTable* components)
 {
-	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
+	struct MXitSession* session = (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	const char* roomname = NULL;
 	struct multimx* multimx = NULL;
 
@@ -555,7 +555,7 @@ void mxit_chat_invite(PurpleConnection *
  */
 void mxit_chat_invite(PurpleConnection *gc, int id, const char *msg, const char *username)
 {
-	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
+	struct MXitSession* session = (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	struct multimx* multimx = NULL;
 
 	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat invite to '%s'\n", username);
@@ -580,7 +580,7 @@ void mxit_chat_leave(PurpleConnection *g
  */
 void mxit_chat_leave(PurpleConnection *gc, int id)
 {
-	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
+	struct MXitSession* session = (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	struct multimx* multimx = NULL;
 
 	purple_debug_info(MXIT_PLUGIN_ID, "Groupchat %i leave\n", id);
@@ -611,7 +611,7 @@ int mxit_chat_send(PurpleConnection *gc,
  */
 int mxit_chat_send(PurpleConnection *gc, int id, const char *message, PurpleMessageFlags flags)
 {
-	struct MXitSession* session = (struct MXitSession*) gc->proto_data;
+	struct MXitSession* session = (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	struct multimx* multimx = NULL;
 	const char* nickname;
 
============================================================
--- libpurple/protocols/mxit/mxit.c	dc64911072f9358f2ee33af22ca466092ede07d9
+++ libpurple/protocols/mxit/mxit.c	6aaf0a8224995a0787df28f49ca96a6f379db6a5
@@ -96,7 +96,7 @@ static void* mxit_link_click( const char
 	is_command = g_str_has_prefix( parts[4], "::type=reply|" );
 
 	/* send click message back to MXit */
-	mxit_send_message( con->proto_data, parts[3], parts[4], FALSE, is_command );
+	mxit_send_message( purple_object_get_protocol_data( PURPLE_OBJECT( con ) ), parts[3], parts[4], FALSE, is_command );
 
 	g_free( link );
 	link = NULL;
@@ -369,7 +369,7 @@ static void mxit_close( PurpleConnection
  */
 static void mxit_close( PurpleConnection* gc )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 
 	/* disable signals */
 	mxit_disable_signals( session );
@@ -403,9 +403,11 @@ static int mxit_send_im( PurpleConnectio
  */
 static int mxit_send_im( PurpleConnection* gc, const char* who, const char* message, PurpleMessageFlags flags )
 {
+	struct MXitSession *session = purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
+
 	purple_debug_info( MXIT_PLUGIN_ID, "Sending message '%s' to buddy '%s'\n", message, who );
 
-	mxit_send_message( gc->proto_data, who, message, TRUE, FALSE );
+	mxit_send_message( session, who, message, TRUE, FALSE );
 
 	return 1;		/* echo to conversation window */
 }
@@ -419,7 +421,7 @@ static void mxit_set_status( PurpleAccou
  */
 static void mxit_set_status( PurpleAccount* account, PurpleStatus* status )
 {
-	struct MXitSession*		session =	purple_account_get_connection( account )->proto_data;
+	struct MXitSession*		session =	purple_object_get_protocol_data( PURPLE_OBJECT( purple_account_get_connection( account ) ) );
 	const char*				statusid;
 	int						presence;
 	char*					statusmsg1;
@@ -512,7 +514,7 @@ static void mxit_keepalive( PurpleConnec
  */
 static void mxit_keepalive( PurpleConnection *gc )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 
 	/* if not logged in, there is nothing to do */
 	if ( !( session->flags & MXIT_FLAG_LOGGEDIN ) )
@@ -540,7 +542,7 @@ static void mxit_set_buddy_icon( PurpleC
  */
 static void mxit_set_buddy_icon( PurpleConnection *gc, PurpleStoredImage *img )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 
 	if ( img == NULL )
 		mxit_set_avatar( session, NULL, 0 );
@@ -557,7 +559,7 @@ static void mxit_get_info( PurpleConnect
  */
 static void mxit_get_info( PurpleConnection *gc, const char *who )
 {
-	struct MXitSession*		session			= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*		session			= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	const char*				profilelist[]	= { CP_PROFILE_BIRTHDATE, CP_PROFILE_GENDER, CP_PROFILE_FULLNAME,
 												CP_PROFILE_FIRSTNAME, CP_PROFILE_LASTNAME, CP_PROFILE_REGCOUNTRY };
 
============================================================
--- libpurple/protocols/mxit/protocol.c	45d6424a6c418ee410a41b95fa0d60b935c40af0
+++ libpurple/protocols/mxit/protocol.c	deda9430e9004273f98d0904ba3bfc927c089178
@@ -445,7 +445,7 @@ static void mxit_queue_packet( struct MX
 	packet->headerlen = 0;
 
 	/* create generic packet header */
-	hlen = sprintf( header,	"id=%s%c", session->acc->username, CP_REC_TERM );			/* client msisdn */
+	hlen = sprintf( header,	"id=%s%c", purple_account_get_username( session->acc ), CP_REC_TERM );			/* client msisdn */
 
 	if ( session->http ) {
 		/* http connection only */
@@ -1291,7 +1291,7 @@ static void mxit_parse_cmd_login( struct
 	/* we were not yet logged in so we need to complete the login sequence here */
 	session->flags |= MXIT_FLAG_LOGGEDIN;
 	purple_connection_update_progress( session->con, _( "Successfully Logged In..." ), 3, 4 );
-	purple_connection_set_state( session->con, PURPLE_CONNECTED );
+	purple_connection_set_state( session->con, PURPLE_CONNECTION_STATE_CONNECTED );
 
 	/* save extra info if this is a HTTP connection */
 	if ( session->http ) {
@@ -2422,6 +2422,7 @@ void mxit_close_connection( struct MXitS
  */
 void mxit_close_connection( struct MXitSession* session )
 {
+	guint inpa;
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_close_connection\n" );
 
 	if ( !( session->flags & MXIT_FLAG_CONNECTED ) ) {
@@ -2444,9 +2445,10 @@ void mxit_close_connection( struct MXitS
 	}
 
 	/* remove the input cb function */
-	if ( session->con->inpa ) {
-		purple_input_remove( session->con->inpa );
-		session->con->inpa = 0;
+	g_object_get( G_OBJECT( session->con ), "inpa", &inpa, NULL );
+	if ( inpa ) {
+		purple_input_remove( inpa );
+		g_object_set( G_OBJECT( session->con ), "inpa", 0, NULL );
 	}
 
 	/* remove HTTP poll timer */
============================================================
--- libpurple/protocols/mxit/roster.c	b15ba396586bf5ef56ff31581bc6b9bb0d2f097e
+++ libpurple/protocols/mxit/roster.c	8b5604d2f09d4eadaecf062b2f1c5e582f606a93
@@ -75,7 +75,7 @@ GList* mxit_status_types( PurpleAccount*
 
 		/* add mxit status (reference: "libpurple/status.h") */
 		type = purple_status_type_new_with_attrs( status->primative, status->id, _( status->name ), TRUE, TRUE, FALSE,
-					"message", _( "Message" ), purple_value_new( PURPLE_TYPE_STRING ),
+					"message", _( "Message" ), purple_g_value_slice_new( G_TYPE_STRING ),
 					NULL );
 
 		statuslist = g_list_append( statuslist, type );
@@ -83,7 +83,7 @@ GList* mxit_status_types( PurpleAccount*
 
 	/* add Mood option */
 	type = purple_status_type_new_with_attrs(PURPLE_STATUS_MOOD, "mood", NULL, FALSE, TRUE, TRUE,
-		PURPLE_MOOD_NAME, _("Mood Name"), purple_value_new( PURPLE_TYPE_STRING ),
+		PURPLE_MOOD_NAME, _("Mood Name"), purple_g_value_slice_new( G_TYPE_STRING ),
 		NULL);
 	statuslist = g_list_append( statuslist, type );
 
@@ -301,7 +301,7 @@ static PurpleBuddy* mxit_update_buddy_gr
 		buddy->proto_data = NULL;
 
 		/* remove the buddy */
-		purple_blist_remove_buddy( buddy );
+		purple_blist_node_remove( PURPLE_BLIST_NODE( buddy ) );
 
 		/* add buddy */
 		purple_blist_add_buddy( newbuddy, NULL, group, NULL );
@@ -375,7 +375,7 @@ void mxit_update_contact( struct MXitSes
 		buddy = purple_find_buddy( session->acc, contact->username );
 		if ( buddy ) {
 			/* ok, so we found him in another group. to switch him between groups we must delete him and add him again. */
-			purple_blist_remove_buddy( buddy );
+			purple_blist_node_remove( PURPLE_BLIST_NODE( buddy ) );
 			buddy = NULL;
 		}
 
@@ -392,7 +392,7 @@ void mxit_update_contact( struct MXitSes
 		gpointer data = NULL;
 
 		/* now update the buddy's alias */
-		purple_blist_alias_buddy( buddy, contact->alias );
+		purple_buddy_set_name( buddy, contact->alias );
 
 		/* replace the buddy's contact struct */
 		if ( ( data = purple_buddy_get_protocol_data( buddy ) ) )
@@ -526,7 +526,7 @@ void mxit_update_blist( struct MXitSessi
 
 			/* this buddy should be removed, because we did not receive him in our roster update from MXit */
 			purple_debug_info( MXIT_PLUGIN_ID, "Removed 'old' buddy from the blist '%s' (%s)\n", alias, name );
-			purple_blist_remove_buddy( buddy );
+			purple_blist_node_remove( PURPLE_BLIST_NODE( buddy ) );
 		}
 	}
 
@@ -640,7 +640,7 @@ void mxit_add_buddy( PurpleConnection* g
  */
 void mxit_add_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	GSList*				list	= NULL;
 	PurpleBuddy*		mxbuddy	= NULL;
 	unsigned int		i;
@@ -676,7 +676,7 @@ void mxit_add_buddy( PurpleConnection* g
 				/* this is our REAL MXit buddy! */
 
 				/* now update the buddy's alias */
-				purple_blist_alias_buddy( mxbuddy, buddy_alias );
+				purple_buddy_set_name( mxbuddy, buddy_alias );
 
 				/* now update the buddy's group */
 //				mxbuddy = mxit_update_buddy_group( session, mxbuddy, group );
@@ -694,7 +694,7 @@ void mxit_add_buddy( PurpleConnection* g
 	 * invalid contact.  so the user will still see the contact as offline
 	 * until he eventually accepts the invite.
 	 */
-	purple_blist_remove_buddy( buddy );
+	purple_blist_node_remove( PURPLE_BLIST_NODE( buddy ) );
 
 	g_slist_free( list );
 }
@@ -709,7 +709,7 @@ void mxit_remove_buddy( PurpleConnection
  */
 void mxit_remove_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	const gchar *		buddy_name = purple_buddy_get_name( buddy );
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_remove_buddy '%s'\n", buddy_name );
@@ -727,7 +727,7 @@ void mxit_buddy_alias( PurpleConnection*
  */
 void mxit_buddy_alias( PurpleConnection* gc, const char* who, const char* alias )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleBuddy*		buddy	= NULL;
 	PurpleGroup*		group	= NULL;
 
@@ -761,7 +761,7 @@ void mxit_buddy_group( PurpleConnection*
  */
 void mxit_buddy_group( PurpleConnection* gc, const char* who, const char* old_group, const char* new_group )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleBuddy*		buddy	= NULL;
 
 	purple_debug_info( MXIT_PLUGIN_ID, "mxit_buddy_group from '%s' to '%s'\n", old_group, new_group );
@@ -788,7 +788,7 @@ void mxit_rename_group( PurpleConnection
  */
 void mxit_rename_group( PurpleConnection* gc, const char* old_name, PurpleGroup* group, GList* moved_buddies )
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	PurpleBuddy*		buddy	= NULL;
 	GList*				item	= NULL;
 
============================================================
--- libpurple/protocols/mxit/splashscreen.c	ea0c77abaf1981e197f5ab7b4b03b653e84c9d40
+++ libpurple/protocols/mxit/splashscreen.c	2a36a0f2dfe28b5a39f9f26b39f2bc13847678a0
@@ -144,7 +144,7 @@ static void splash_click_ok(PurpleConnec
  */
 static void splash_click_ok(PurpleConnection* gc, PurpleRequestFields* fields)
 {
-	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
+	struct MXitSession*	session	= (struct MXitSession*) purple_object_get_protocol_data( PURPLE_OBJECT( gc ) );
 	const char* splashId;
 
 	/* Get current splash ID */


More information about the Commits mailing list