diff libpurple/protocols/mxit/protocol.c @ 30002:30d0d4756fac

* 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.
author andrew.victor@mxit.com
date Thu, 20 May 2010 09:29:46 +0000
parents 5622de6b7b8d
children 08cae68b25dc
line wrap: on
line diff
--- 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 */