# HG changeset patch # User andrew.victor@mxit.com # Date 1274354490 0 # Node ID 08cae68b25dcb66cac60c9967c5de7255e45e735 # Parent 30d0d4756facb4434f637fa98212dbb4553ab60e Save the user's MXitId received in the login-response packet to the Session. Display the MXitId (read-only) in the profile information. diff -r 30d0d4756fac -r 08cae68b25dc libpurple/protocols/mxit/actions.c --- a/libpurple/protocols/mxit/actions.c Thu May 20 09:29:46 2010 +0000 +++ b/libpurple/protocols/mxit/actions.c Thu May 20 11:21:30 2010 +0000 @@ -225,6 +225,13 @@ 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 ); diff -r 30d0d4756fac -r 08cae68b25dc libpurple/protocols/mxit/mxit.h --- a/libpurple/protocols/mxit/mxit.h Thu May 20 09:29:46 2010 +0000 +++ b/libpurple/protocols/mxit/mxit.h Thu May 20 11:21:30 2010 +0000 @@ -151,6 +151,7 @@ /* 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 */ diff -r 30d0d4756fac -r 08cae68b25dc libpurple/protocols/mxit/protocol.c --- a/libpurple/protocols/mxit/protocol.c Thu May 20 09:29:46 2010 +0000 +++ b/libpurple/protocols/mxit/protocol.c Thu May 20 11:21:30 2010 +0000 @@ -1302,6 +1302,10 @@ 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 @@ mxit_free_emoticon_cache( session ); /* free allocated memory */ + if ( session->mxitId ) + g_free( session->mxitId ); g_free( session->encpwd ); session->encpwd = NULL;