changeset 32411:e4ae42f9da68

merge of 'b11803e108556a29e1204a3ff1fd00a0890d7733' and 'da7bc1419142f97b2def127ef42c9c7c562e77e3'
author andrew.victor@mxit.com
date Wed, 24 Aug 2011 06:45:30 +0000
parents 4fa86d2d1778 (current diff) 26f61ef1224b (diff)
children e86e00f77ca4
files libpurple/protocols/mxit/login.c
diffstat 1 files changed, 7 insertions(+), 6 deletions(-) [+]
line wrap: on
line diff
--- a/libpurple/protocols/mxit/login.c	Wed Aug 24 03:52:06 2011 +0000
+++ b/libpurple/protocols/mxit/login.c	Wed Aug 24 06:45:30 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 );