changeset 32409:9d7c8d6f4a66

Rather use the accessor function purple_account_get_username().
author andrew.victor@mxit.com
date Tue, 23 Aug 2011 08:23:36 +0000
parents 5dafa68c8eb0
children 26f61ef1224b
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	Tue Aug 23 05:43:51 2011 +0000
+++ b/libpurple/protocols/mxit/login.c	Tue Aug 23 08:23:36 2011 +0000
@@ -53,13 +53,14 @@
 	PurpleConnection*	con			= 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( &account->username[1] );
+			purple_account_set_username( account, fixed );
+			g_free( fixed );
+		}
 	}
 
 	session = g_new0( struct MXitSession, 1 );