pidgin.mxit: 32ced579: Add the invite message support to MXit p...

andrew.victor at mxit.com andrew.victor at mxit.com
Mon Mar 21 12:36:19 EDT 2011


----------------------------------------------------------------------
Revision: 32ced579624d883181409ef15d340daa0b5b084e
Parent:   1214e5a1d1973ec17c2ffee39cefb6c49d209502
Author:   andrew.victor at mxit.com
Date:     03/21/11 12:30:01
Branch:   im.pidgin.pidgin.mxit
URL: http://d.pidgin.im/viewmtn/revision/info/32ced579624d883181409ef15d340daa0b5b084e

Changelog: 

Add the invite message support to MXit prpl.


Changes against parent 1214e5a1d1973ec17c2ffee39cefb6c49d209502

  patched  ChangeLog
  patched  libpurple/protocols/mxit/mxit.c
  patched  libpurple/protocols/mxit/protocol.c
  patched  libpurple/protocols/mxit/protocol.h
  patched  libpurple/protocols/mxit/roster.c
  patched  libpurple/protocols/mxit/roster.h

-------------- next part --------------
============================================================
--- ChangeLog	afd18e29cf15b04badf81aacab417a11cc27df5e
+++ ChangeLog	022c7f1e5e44008c8c7ca1795ea63077d23fba72
@@ -22,6 +22,9 @@ version 2.8.0 (??/??/????):
 	ICQ:
 	* Fix unsetting your mood when "None" is selected. (#7431)
 
+	MXit:
+	* Support for an Invite Message when adding a buddy.
+
 	Windows-Specific Changes:
 	* Fix building libpurple with Visual C++ .NET 2005. This was accidentally
 	  broken in 2.7.11. (Florian Qu?ze)
============================================================
--- libpurple/protocols/mxit/mxit.c	e39d83ff73fe0cbb24d0b348ff4bad770362a756
+++ libpurple/protocols/mxit/mxit.c	bfe2251f633169336ff035801c7e1288ed39f861
@@ -628,7 +628,7 @@ static void mxit_reinvite( PurpleBlistNo
 		return;
 
 	/* send a new invite */
-	mxit_send_invite( session, contact->username, contact->alias, contact->groupname );
+	mxit_send_invite( session, contact->username, contact->alias, contact->groupname, NULL );
 }
 
 
@@ -664,7 +664,7 @@ static PurplePluginProtocolInfo proto_in
 /*========================================================================================================================*/
 
 static PurplePluginProtocolInfo proto_info = {
-	OPT_PROTO_REGISTER_NOSCREENNAME | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_IM_IMAGE,			/* options */
+	OPT_PROTO_REGISTER_NOSCREENNAME | OPT_PROTO_UNIQUE_CHATNAME | OPT_PROTO_IM_IMAGE | OPT_PROTO_INVITE_MESSAGE,			/* options */
 	NULL,					/* user_splits */
 	NULL,					/* protocol_options */
 	{						/* icon_spec */
@@ -692,7 +692,7 @@ static PurplePluginProtocolInfo proto_in
 	mxit_set_status,		/* set_status */
 	NULL,					/* set_idle */
 	NULL,					/* change_passwd */
-	mxit_add_buddy,			/* add_buddy				[roster.c] */
+	NULL,					/* add_buddy				[roster.c] */
 	NULL,					/* add_buddies */
 	mxit_remove_buddy,		/* remove_buddy				[roster.c] */
 	NULL,					/* remove_buddies */
@@ -743,7 +743,7 @@ static PurplePluginProtocolInfo proto_in
 	mxit_get_moods,			/* get_moods */
 	NULL,					/* set_public_alias */
 	NULL,					/* get_public_alias */
-	NULL,					/* add_buddy_with_invite */
+	mxit_add_buddy,			/* add_buddy_with_invite */
 	NULL					/* add_buddies_with_invite */
 };
 
============================================================
--- libpurple/protocols/mxit/protocol.c	3043aec5ae922abfa6cf414af63fcc12126875ef
+++ libpurple/protocols/mxit/protocol.c	7fa0f5d313660b490abcc14c675bcd7fe8290da5
@@ -987,8 +987,9 @@ void mxit_send_mood( struct MXitSession*
  *  @param username		The username of the contact being invited
  *  @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 )
+void mxit_send_invite( struct MXitSession* session, const char* username, const char* alias, const char* groupname, const char* message )
 {
 	char		data[CP_MAX_PACKET];
 	int			datalen;
@@ -997,7 +998,7 @@ void mxit_send_invite( struct MXitSessio
 	datalen = snprintf( data, sizeof( data ),
 								"ms=%s%c%s%c%s%c%i%c%s",	/* "ms"=group\1username\1alias\1type\1msg */
 								groupname, CP_FLD_TERM, username, CP_FLD_TERM, alias,
-								CP_FLD_TERM, MXIT_TYPE_MXIT, CP_FLD_TERM, ""
+								CP_FLD_TERM, MXIT_TYPE_MXIT, CP_FLD_TERM, ( message ? message : "" )
 	);
 
 	/* queue packet for transmission */
============================================================
--- libpurple/protocols/mxit/protocol.h	7d9ad1e196c3935b9e52be2dc31c626b8b5d6f8a
+++ libpurple/protocols/mxit/protocol.h	3d16d012a2b4a30107ee1723437981f693aebd59
@@ -305,7 +305,7 @@ void mxit_send_suggest_search( struct MX
 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 );
+void mxit_send_invite( struct MXitSession* session, const char* username, 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 );
============================================================
--- libpurple/protocols/mxit/roster.c	875ace8019997d1dc51abbb29e646260b62e516b
+++ libpurple/protocols/mxit/roster.c	b680ad15a3e8ff2704061a5ca5b82860bb106f1c
@@ -680,8 +680,9 @@ gboolean is_mxit_chatroom_contact( struc
  *  @param gc		The connection object
  *  @param buddy	The new buddy
  *  @param group	The group of the new buddy
+ *  @param message	The invite message
  */
-void mxit_add_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group )
+void mxit_add_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group, const char* message )
 {
 	struct MXitSession*	session	= (struct MXitSession*) gc->proto_data;
 	GSList*				list	= NULL;
@@ -702,7 +703,7 @@ void mxit_add_buddy( PurpleConnection* g
 		 * 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 );
+		mxit_send_invite( session, buddy_name, buddy_alias, group_name, message );
 	}
 	else {
 		purple_debug_info( MXIT_PLUGIN_ID, "mxit_add_buddy (scenario 2) (list:%i)\n", g_slist_length( list ) );
============================================================
--- libpurple/protocols/mxit/roster.h	11921a1739ca66da856e6184197248434899508d
+++ libpurple/protocols/mxit/roster.h	3eeee5fd180b46d6e508191ac8cf6a7702702623
@@ -142,7 +142,7 @@ gboolean is_mxit_chatroom_contact( struc
 gboolean is_mxit_chatroom_contact( struct MXitSession* session, const char* username );
 
 /* libPurple callbacks */
-void mxit_add_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group );
+void mxit_add_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group, const char* message );
 void mxit_remove_buddy( PurpleConnection* gc, PurpleBuddy* buddy, PurpleGroup* group );
 void mxit_buddy_alias( PurpleConnection* gc, const char* who, const char* alias );
 void mxit_buddy_group( PurpleConnection* gc, const char* who, const char* old_group, const char* new_group );


More information about the Commits mailing list