changeset 32412:e86e00f77ca4

merge of '832455fec73731ef93c992a46f78b79981bb4105' and '9d78a21f49219b234b21c2dd2023c4ad160a2c9c'
author andrew.victor@mxit.com
date Thu, 25 Aug 2011 06:40:04 +0000
parents 16b33ffd75f8 (current diff) e4ae42f9da68 (diff)
children 022a82d394c2
files
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/login.c	Thu Aug 25 04:40:34 2011 +0000
+++ b/libpurple/protocols/mxit/login.c	Thu Aug 25 06:40:04 2011 +0000
@@ -53,13 +53,14 @@
 	struct MXitSession*	session		= NULL;
 
 	/* currently the wapsite does not handle a '+' in front of the username (mxitid) so we just strip it */
-	if ( account->username[0] == '+' ) {
-		char*		fixed;
+	{
+		const char* username	= purple_account_get_username( account );
 
-		/* cut off the '+' */
-		fixed = g_strdup( &account->username[1] );
-		purple_account_set_username( account, fixed );
-		g_free( fixed );
+		if ( username[0] == '+' ) {
+			char* fixed	= g_strdup( &username[1] );
+			purple_account_set_username( account, fixed );
+			g_free( fixed );
+		}
 	}
 
 	session = g_new0( struct MXitSession, 1 );