changeset 31506:2e4ac25df4ba

Protocol 6.3 change to SubscribeContact packet.
author andrew.victor@mxit.com
date Tue, 12 Apr 2011 19:55:13 +0000
parents 67c2d695e8d5
children efed7d3c5574
files libpurple/protocols/mxit/mxit.c libpurple/protocols/mxit/protocol.c libpurple/protocols/mxit/protocol.h libpurple/protocols/mxit/roster.c
diffstat 4 files changed, 9 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/mxit.c	Mon Apr 11 22:16:34 2011 +0000
+++ b/libpurple/protocols/mxit/mxit.c	Tue Apr 12 19:55:13 2011 +0000
@@ -626,7 +626,7 @@
 		return;
 
 	/* send a new invite */
-	mxit_send_invite( session, contact->username, contact->alias, contact->groupname, NULL );
+	mxit_send_invite( session, contact->username, TRUE, contact->alias, contact->groupname, NULL );
 }
 
 
--- a/libpurple/protocols/mxit/protocol.c	Mon Apr 11 22:16:34 2011 +0000
+++ b/libpurple/protocols/mxit/protocol.c	Tue Apr 12 19:55:13 2011 +0000
@@ -990,20 +990,23 @@
  *
  *  @param session		The MXit session object
  *  @param username		The username of the contact being invited
+ *  @param mxitid		Indicates the username is a MXitId.
  *  @param alias		Our alias for the contact
  *  @param groupname	Group in which contact should be stored.
  *  @param message		Invite message
  */
-void mxit_send_invite( struct MXitSession* session, const char* username, const char* alias, const char* groupname, const char* message )
+void mxit_send_invite( struct MXitSession* session, const char* username, gboolean mxitid, const char* alias, const char* groupname, const char* message )
 {
 	char		data[CP_MAX_PACKET];
 	int			datalen;
 
 	/* convert the packet to a byte stream */
 	datalen = snprintf( data, sizeof( data ),
-								"ms=%s%c%s%c%s%c%i%c%s",	/* "ms"=group\1username\1alias\1type\1msg */
+								"ms=%s%c%s%c%s%c%i%c%s%c%i",	/* "ms"=group \1 username \1 alias \1 type \1 msg \1 isuserid */
 								groupname, CP_FLD_TERM, username, CP_FLD_TERM, alias,
-								CP_FLD_TERM, MXIT_TYPE_MXIT, CP_FLD_TERM, ( message ? message : "" )
+								CP_FLD_TERM, MXIT_TYPE_MXIT, CP_FLD_TERM,
+								( message ? message : "" ), CP_FLD_TERM,
+								( mxitid ? 0 : 1 )
 	);
 
 	/* queue packet for transmission */
--- a/libpurple/protocols/mxit/protocol.h	Mon Apr 11 22:16:34 2011 +0000
+++ b/libpurple/protocols/mxit/protocol.h	Tue Apr 12 19:55:13 2011 +0000
@@ -309,7 +309,7 @@
 void mxit_send_suggest_friends( struct MXitSession* session, int max, unsigned int nr_attrib, const char* attribute[] );
 void mxit_send_suggest_search( struct MXitSession* session, int max, const char* text, unsigned int nr_attrib, const char* attribute[] );
 
-void mxit_send_invite( struct MXitSession* session, const char* username, const char* alias, const char* groupname, const char* message );
+void mxit_send_invite( struct MXitSession* session, const char* username, gboolean mxitid, const char* alias, const char* groupname, const char* message );
 void mxit_send_remove( struct MXitSession* session, const char* username );
 void mxit_send_allow_sub( struct MXitSession* session, const char* username, const char* alias );
 void mxit_send_deny_sub( struct MXitSession* session, const char* username );
--- a/libpurple/protocols/mxit/roster.c	Mon Apr 11 22:16:34 2011 +0000
+++ b/libpurple/protocols/mxit/roster.c	Tue Apr 12 19:55:13 2011 +0000
@@ -747,7 +747,7 @@
 		 * you accept an invite.  so in that case the user is already
 		 * in our blist and ready to be chatted to.
 		 */
-		mxit_send_invite( session, buddy_name, buddy_alias, group_name, message );
+		mxit_send_invite( session, buddy_name, TRUE, buddy_alias, group_name, message );
 	}
 	else {
 		purple_debug_info( MXIT_PLUGIN_ID, "mxit_add_buddy (scenario 2) (list:%i)\n", g_slist_length( list ) );