pidgin.mxit: 80733d17: * Separate the ClientVersion from the su...

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


-----------------------------------------------------------------
Revision: 80733d17e9ad100784d45e07f1590c85c794720a
Ancestor: 339168b713a11eedc7a4f6ffd6cb9ee960254448
Author: andrew.victor at mxit.com
Date: 2010-05-20T09:29:46
Branch: im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/80733d17e9ad100784d45e07f1590c85c794720a

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

ChangeLog: 

* 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.


-------------- next part --------------
============================================================
--- libpurple/protocols/mxit/actions.c	dc2dd054f9f647a1af7eb62a6325d021197e26d2
+++ libpurple/protocols/mxit/actions.c	2453b923803fbb62b4564df2c26fbcee22efddb6
@@ -304,11 +304,12 @@ static void mxit_cb_action_about( Purple
 	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 );
 }
============================================================
--- libpurple/protocols/mxit/mxit.c	17bfe33db888b98f6e9156bd0bfce4ccdaa87fbd
+++ libpurple/protocols/mxit/mxit.c	dc64911072f9358f2ee33af22ca466092ede07d9
@@ -352,6 +352,10 @@ static void mxit_tooltip( PurpleBuddy* b
 	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 @@ static void mxit_free_buddy( PurpleBuddy
 			g_free( contact->statusMsg );
 		if ( contact->avatarId )
 			g_free( contact->avatarId );
+		if ( contact->msg )
+			g_free( contact->msg );
 		g_free( contact );
 	}
 
============================================================
--- libpurple/protocols/mxit/protocol.c	1808bdc85c06090b1b83f43c8f51383c4b367d2b
+++ libpurple/protocols/mxit/protocol.c	ebf3535c3cd215e4d0270e1302e533b1b85c6cb5
@@ -672,10 +672,12 @@ void mxit_send_login( struct MXitSession
 	/* 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 @@ static void mxit_parse_cmd_contact( stru
 		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 */
============================================================
--- libpurple/protocols/mxit/protocol.h	3e0bc909d885e7c4664d151d9391685f0c9ba38d
+++ libpurple/protocols/mxit/protocol.h	c9f8d1f6f7edb363d06d614410ace8c8e255105e
@@ -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__ )


More information about the Commits mailing list