# HG changeset patch # User andrew.victor@mxit.com # Date 1274347786 0 # Node ID 30d0d4756facb4434f637fa98212dbb4553ab60e # Parent 6e4fa807abd4d3ccf8db69271681ff64e53dda51 * Separate the ClientVersion from the supported ProtocolVersion. * Increment the protocol version we use from v5.9 to v6.0, and update the Login Request packet accordingly. * Protocol v6.0 supports Invite Rejection messages, so if an invite we sent was rejected then display it in the buddy tooltip. diff -r 6e4fa807abd4 -r 30d0d4756fac libpurple/protocols/mxit/actions.c --- a/libpurple/protocols/mxit/actions.c Thu May 20 09:03:37 2010 +0000 +++ b/libpurple/protocols/mxit/actions.c Thu May 20 09:29:46 2010 +0000 @@ -304,11 +304,12 @@ char version[256]; g_snprintf( version, sizeof( version ), "MXit libPurple Plugin v%s\n" - "MXit Client Protocol v%s\n\n" + "MXit Client Protocol v%i.%i\n\n" "Author:\nPieter Loubser\n\n" "Contributors:\nAndrew Victor\n\n" "Testers:\nBraeme Le Roux\n\n", - MXIT_PLUGIN_VERSION, MXIT_CP_RELEASE ); + MXIT_PLUGIN_VERSION, + ( MXIT_CP_PROTO_VESION / 10 ), ( MXIT_CP_PROTO_VESION % 10 ) ); mxit_popup( PURPLE_NOTIFY_MSG_INFO, _( "About" ), version ); } diff -r 6e4fa807abd4 -r 30d0d4756fac libpurple/protocols/mxit/mxit.c --- a/libpurple/protocols/mxit/mxit.c Thu May 20 09:03:37 2010 +0000 +++ b/libpurple/protocols/mxit/mxit.c Thu May 20 09:29:46 2010 +0000 @@ -352,6 +352,10 @@ if ( contact->subtype != 0 ) purple_notify_user_info_add_pair( info, _( "Subscription" ), mxit_convert_subtype_to_name( contact->subtype ) ); + /* rejection message */ + if ( ( contact->subtype == MXIT_SUBTYPE_REJECTED ) && ( contact->msg != NULL ) ) + purple_notify_user_info_add_pair( info, _( "Rejection Message" ), contact->msg ); + /* hidden number */ if ( contact->flags & MXIT_CFLAG_HIDDEN ) purple_notify_user_info_add_pair( info, _( "Hidden Number" ), _( "Yes" ) ); @@ -491,6 +495,8 @@ g_free( contact->statusMsg ); if ( contact->avatarId ) g_free( contact->avatarId ); + if ( contact->msg ) + g_free( contact->msg ); g_free( contact ); } diff -r 6e4fa807abd4 -r 30d0d4756fac libpurple/protocols/mxit/protocol.c --- a/libpurple/protocols/mxit/protocol.c Thu May 20 09:03:37 2010 +0000 +++ b/libpurple/protocols/mxit/protocol.c Thu May 20 09:29:46 2010 +0000 @@ -672,10 +672,12 @@ /* convert the packet to a byte stream */ datalen = sprintf( data, "ms=%s%c%s%c%i%c" /* "ms"=password\1version\1getContacts\1 */ "%s%c%s%c%i%c" /* capabilities\1dc\1features\1 */ - "%s%c%s", /* dialingcode\1locale */ + "%s%c%s%c" /* dialingcode\1locale\1 */ + "%i%c%i%c%i", /* maxReplyLen\1protocolVer\1lastRosterUpdate */ session->encpwd, CP_FLD_TERM, MXIT_CP_VERSION, CP_FLD_TERM, 1, CP_FLD_TERM, MXIT_CP_CAP, CP_FLD_TERM, session->distcode, CP_FLD_TERM, MXIT_CP_FEATURES, CP_FLD_TERM, - session->dialcode, CP_FLD_TERM, locale + session->dialcode, CP_FLD_TERM, locale, CP_FLD_TERM, + CP_MAX_FILESIZE, CP_FLD_TERM, MXIT_CP_PROTO_VESION, CP_FLD_TERM, 0 ); /* include "custom resource" information */ @@ -1513,10 +1515,14 @@ contact->mood = atoi( rec->fields[5]->data ); if ( rec->fcount > 6 ) { - /* added in protocol 5.9.0 - flags & subtype */ + /* added in protocol 5.9 - flags & subtype */ contact->flags = atoi( rec->fields[6]->data ); contact->subtype = rec->fields[7]->data[0]; } + if ( rec->fcount > 8 ) { + /* added in protocol 6.0 - reject message */ + contact->msg = g_strdup( rec->fields[8]->data ); + } /* add the contact to the buddy list */ if ( contact-> type == MXIT_TYPE_MULTIMX ) /* contact is a MultiMX room */ diff -r 6e4fa807abd4 -r 30d0d4756fac libpurple/protocols/mxit/protocol.h --- a/libpurple/protocols/mxit/protocol.h Thu May 20 09:03:37 2010 +0000 +++ b/libpurple/protocols/mxit/protocol.h Thu May 20 09:29:46 2010 +0000 @@ -85,11 +85,12 @@ /* MXit client version */ #define MXIT_CP_DISTCODE "P" /* client distribution code (magic, do not touch!) */ -#define MXIT_CP_RELEASE "5.9.0" /* client protocol release version supported */ +#define MXIT_CP_RELEASE "5.9.0" /* client version */ #define MXIT_CP_ARCH "Y" /* client architecture series (Y not for Yoda but for PC-client) */ #define MXIT_CLIENT_ID "LP" /* client ID as specified by MXit */ #define MXIT_CP_PLATFORM "PURPLE" /* client platform */ #define MXIT_CP_VERSION MXIT_CP_DISTCODE"-"MXIT_CP_RELEASE"-"MXIT_CP_ARCH"-"MXIT_CP_PLATFORM +#define MXIT_CP_PROTO_VESION 60 /* client protocol version */ /* set operating system name */ #if defined( __APPLE__ )