diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-18 20:21:44 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-08-18 20:21:44 +0100 | 
| commit | 80175a1558f297d5505ed4e91a261781ec9c65a2 (patch) | |
| tree | 64858b0b395fa81b0aae9b101c897ab4dd79a6ea /protocols/msn/ns.c | |
| parent | e0e15468835d5ae5bce54a28bd7a5b7aea66a1e2 (diff) | |
Fetch the user's profile to see if there's a display name set there. If
there is, the one in the address book should be ignored. No support for
changing the profile yet though.
Diffstat (limited to 'protocols/msn/ns.c')
| -rw-r--r-- | protocols/msn/ns.c | 29 | 
1 files changed, 18 insertions, 11 deletions
| diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index c9b01ef2..4b779a58 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -258,23 +258,14 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts )  	else if( strcmp( cmd[0], "BLP" ) == 0 )  	{  		msn_ns_send_adl_start( ic ); -		 -		if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) -			return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) ); +		return msn_ns_finish_login( ic );  	}  	else if( strcmp( cmd[0], "ADL" ) == 0 )  	{  		if( num_parts >= 3 && strcmp( cmd[2], "OK" ) == 0 )  		{  			msn_ns_send_adl( ic ); -			 -			if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) -			{ -				msn_ns_send_adl( ic ); -				 -				if( md->adl_todo < 0 && !( ic->flags & OPT_LOGGED_IN ) ) -					return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) ); -			} +			return msn_ns_finish_login( ic );  		}  		else if( num_parts >= 3 )  		{ @@ -817,3 +808,19 @@ static void msn_ns_send_adl_start( struct im_connection *ic )  	msn_ns_send_adl( ic );  } + +int msn_ns_finish_login( struct im_connection *ic ) +{ +	struct msn_data *md = ic->proto_data; +	 +	if( ic->flags & OPT_LOGGED_IN ) +		return 1; +	 +	if( md->adl_todo < 0 ) +		md->flags |= MSN_DONE_ADL; +	 +	if( ( md->flags & MSN_DONE_ADL ) && ( md->flags & MSN_GOT_PROFILE ) ) +		return msn_ns_set_display_name( ic, set_getstr( &ic->acc->set, "display_name" ) ); +	else +		return 1; +} | 
