pidgin.mxit: f36af3ce: Save the user's MXitId received in the l...

andrew.victor at mxit.com andrew.victor at mxit.com
Thu May 20 08:14:59 EDT 2010


-----------------------------------------------------------------
Revision: f36af3ce21a72ca6c4616108e7e156666d092009
Ancestor: 80733d17e9ad100784d45e07f1590c85c794720a
Author: andrew.victor at mxit.com
Date: 2010-05-20T11:21:30
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/f36af3ce21a72ca6c4616108e7e156666d092009

Modified files:
        libpurple/protocols/mxit/actions.c
        libpurple/protocols/mxit/mxit.h
        libpurple/protocols/mxit/protocol.c

ChangeLog: 

Save the user's MXitId received in the login-response packet to the Session.
Display the MXitId (read-only) in the profile information.


-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/actions.c	2453b923803fbb62b4564df2c26fbcee22efddb6
+++ libpurple/protocols/mxit/actions.c	09a1faf94e3d8faca80b46b142ea0a1c91f2b36e
@@ -225,6 +225,13 @@ static void mxit_cb_action_profile( Purp
 	group = purple_request_field_group_new( NULL );
 	purple_request_fields_add_group( fields, group );
 
+	/* mxitId (read-only) */
+	if ( session->mxitId ) {
+		field = purple_request_field_string_new( "mxitid", _( "Your MXitId" ), session->mxitId, FALSE );
+		purple_request_field_string_set_editable( field, FALSE );
+		purple_request_field_group_add_field( group, field );
+	}
+
 	/* pin */
 	field = purple_request_field_string_new( "pin", _( "PIN" ), session->acc->password, FALSE );
 	purple_request_field_string_set_masked( field, TRUE );
============================================================
--- libpurple/protocols/mxit/mxit.h	75df32f9001318da45e66615c3d2ce8470f49992
+++ libpurple/protocols/mxit/mxit.h	71ccf7b24a94ad4baec68faa1176290dd58fa454
@@ -151,6 +151,7 @@ struct MXitSession {
 
 	/* personal (profile) */
 	struct MXitProfile*	profile;					/* user's profile information */
+	char*				mxitId;						/* the user's MXitId */
 
 	/* libpurple */
 	PurpleAccount*		acc;						/* pointer to the libpurple internal account struct */
============================================================
--- libpurple/protocols/mxit/protocol.c	ebf3535c3cd215e4d0270e1302e533b1b85c6cb5
+++ libpurple/protocols/mxit/protocol.c	4c3a78e4f1cc82368e5d8d5341758978cd593616
@@ -1302,6 +1302,10 @@ static void mxit_parse_cmd_login( struct
 		session->http_sesid = atoi( records[0]->fields[0]->data );
 	}
 
+	/* extract MXitId (from protocol 5.9) */
+	if ( records[1]->fcount >= 9 )
+		session->mxitId = g_strdup( records[1]->fields[8]->data );
+
 	/* display the current splash-screen */
 	if ( splash_popup_enabled( session ) )
 		splash_display( session );
@@ -2483,6 +2487,8 @@ void mxit_close_connection( struct MXitS
 	mxit_free_emoticon_cache( session );
 
 	/* free allocated memory */
+	if ( session->mxitId )
+		g_free( session->mxitId );
 	g_free( session->encpwd );
 	session->encpwd = NULL;
 


More information about the Commits mailing list