Index: protocols/msn/msn.c
===================================================================
--- protocols/msn/msn.c	(revision 2bc8ac0680e6a04f8431003ab468bb6e419534ed)
+++ protocols/msn/msn.c	(revision b051d39d99219852a1dc79f68ee301fc1fe16a5e)
@@ -139,6 +139,7 @@
 	
 	if( l == NULL )
-		for( i = 0; msn_away_state_list[i].number > -1; i ++ )
-			l = g_list_append( l, (void*) msn_away_state_list[i].name );
+		for( i = 0; *msn_away_state_list[i].code; i ++ )
+			if( *msn_away_state_list[i].name )
+				l = g_list_append( l, (void*) msn_away_state_list[i].name );
 	
 	return l;
@@ -149,15 +150,12 @@
 	char buf[1024];
 	struct msn_data *md = ic->proto_data;
-	const struct msn_away_state *st;
-	
-	if( strcmp( state, GAIM_AWAY_CUSTOM ) == 0 )
-		st = msn_away_state_by_name( "Away" );
+	
+	if( state )
+		md->away_state = msn_away_state_by_name( state ) ? :
+		                 msn_away_state_list + 1;
 	else
-		st = msn_away_state_by_name( state );
-	
-	if( !st ) st = msn_away_state_list;
-	md->away_state = st;
-	
-	g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, st->code );
+		md->away_state = msn_away_state_list;
+	
+	g_snprintf( buf, sizeof( buf ), "CHG %d %s\r\n", ++md->trId, md->away_state->code );
 	msn_write( ic, buf, strlen( buf ) );
 }
Index: protocols/msn/msn.h
===================================================================
--- protocols/msn/msn.h	(revision 2bc8ac0680e6a04f8431003ab468bb6e419534ed)
+++ protocols/msn/msn.h	(revision b051d39d99219852a1dc79f68ee301fc1fe16a5e)
@@ -97,5 +97,4 @@
 struct msn_away_state
 {
-	int number;
 	char code[4];
 	char name[16];
Index: protocols/msn/ns.c
===================================================================
--- protocols/msn/ns.c	(revision 2bc8ac0680e6a04f8431003ab468bb6e419534ed)
+++ protocols/msn/ns.c	(revision b051d39d99219852a1dc79f68ee301fc1fe16a5e)
@@ -420,9 +420,10 @@
 		{
 			/* FIXME: Warn/Bomb about unknown away state? */
-			st = msn_away_state_list;
-		}
-		
-		imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN |
-		                   ( st->number ? OPT_AWAY : 0 ), st->name, NULL );
+			st = msn_away_state_list + 1;
+		}
+		
+		imcb_buddy_status( ic, cmd[3], OPT_LOGGED_IN | 
+		                   ( st != msn_away_state_list ? OPT_AWAY : 0 ),
+		                   st->name, NULL );
 	}
 	else if( strcmp( cmd[0], "FLN" ) == 0 )
@@ -449,9 +450,10 @@
 		{
 			/* FIXME: Warn/Bomb about unknown away state? */
-			st = msn_away_state_list;
-		}
-		
-		imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN |
-		                   ( st->number ? OPT_AWAY : 0 ), st->name, NULL );
+			st = msn_away_state_list + 1;
+		}
+		
+		imcb_buddy_status( ic, cmd[2], OPT_LOGGED_IN | 
+		                   ( st != msn_away_state_list ? OPT_AWAY : 0 ),
+		                   st->name, NULL );
 	}
 	else if( strcmp( cmd[0], "RNG" ) == 0 )
Index: protocols/msn/tables.c
===================================================================
--- protocols/msn/tables.c	(revision 2bc8ac0680e6a04f8431003ab468bb6e419534ed)
+++ protocols/msn/tables.c	(revision b051d39d99219852a1dc79f68ee301fc1fe16a5e)
@@ -29,25 +29,14 @@
 const struct msn_away_state msn_away_state_list[] =
 {
-	{  0, "NLN", "Available" },
-	{  1, "BSY", "Busy" },
-	{  3, "IDL", "Idle" },
-	{  5, "BRB", "Be Right Back" },
-	{  7, "AWY", "Away" },
-	{  9, "PHN", "On the Phone" },
-	{ 11, "LUN", "Out to Lunch" },
-	{ 13, "HDN", "Hidden" },
-	{ -1, "",    "" }
+	{ "NLN", "" },
+	{ "BSY", "Busy" },
+	{ "IDL", "Idle" },
+	{ "BRB", "Be Right Back" },
+	{ "AWY", "Away" },
+	{ "PHN", "On the Phone" },
+	{ "LUN", "Out to Lunch" },
+	{ "HDN", "Hidden" },
+	{ "",    "" }
 };
-
-const struct msn_away_state *msn_away_state_by_number( int number )
-{
-	int i;
-	
-	for( i = 0; msn_away_state_list[i].number > -1; i ++ )
-		if( msn_away_state_list[i].number == number )
-			return( msn_away_state_list + i );
-	
-	return( NULL );
-}
 
 const struct msn_away_state *msn_away_state_by_code( char *code )
@@ -55,9 +44,9 @@
 	int i;
 	
-	for( i = 0; msn_away_state_list[i].number > -1; i ++ )
+	for( i = 0; *msn_away_state_list[i].code; i ++ )
 		if( g_strcasecmp( msn_away_state_list[i].code, code ) == 0 )
 			return( msn_away_state_list + i );
 	
-	return( NULL );
+	return NULL;
 }
 
@@ -66,9 +55,9 @@
 	int i;
 	
-	for( i = 0; msn_away_state_list[i].number > -1; i ++ )
+	for( i = 0; *msn_away_state_list[i].code; i ++ )
 		if( g_strcasecmp( msn_away_state_list[i].name, name ) == 0 )
 			return( msn_away_state_list + i );
 	
-	return( NULL );
+	return NULL;
 }
 
