diff libpurple/protocols/mxit/roster.c @ 32080:08dccf527457

Adding contacts normally and via search-results works slightly differently in MXit. The 'Invite' button on the search-results window pops-up the standard "Add Buddy" window, and so the prpl doesn't know what type of invite to perform. To get around this problem for now, we'll encode this in the search-results userId and the prpl can detect this and perform the right type of invite.
author andrew.victor@mxit.com
date Tue, 03 May 2011 20:29:59 +0000
parents 2e4ac25df4ba
children 36a569ed9cdb
line wrap: on
line diff
--- a/libpurple/protocols/mxit/roster.c	Mon May 02 11:00:39 2011 +0000
+++ b/libpurple/protocols/mxit/roster.c	Tue May 03 20:29:59 2011 +0000
@@ -747,7 +747,14 @@
 		 * 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, TRUE, buddy_alias, group_name, message );
+
+		if ( buddy_name[0] == '#' ) {
+			gchar *tmp = (gchar*) purple_base64_decode( buddy_name + 1, NULL );
+			mxit_send_invite( session, tmp, FALSE, buddy_alias, group_name, message );
+			g_free( tmp );
+		}
+		else
+			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 ) );