diff options
author | Wilmer van der Gaast <wilmer@gaast.net> | 2008-07-31 21:44:43 +0100 |
---|---|---|
committer | Wilmer van der Gaast <wilmer@gaast.net> | 2008-07-31 21:44:43 +0100 |
commit | 0f4c2734cd78168c42700d773cca666fab363f66 (patch) | |
tree | 73ff82d1ef19bdab8f15f2369918a4e27ddef6dc /protocols/msn/ns.c | |
parent | 718e05f842c1af043eb4efded8b0afe429377f70 (diff) |
Reverting to the old MSN/Passport authentication mechanism, the new one
is "broken". (Bug #439)
Diffstat (limited to 'protocols/msn/ns.c')
-rw-r--r-- | protocols/msn/ns.c | 30 |
1 files changed, 13 insertions, 17 deletions
diff --git a/protocols/msn/ns.c b/protocols/msn/ns.c index fe48f96d..96363778 100644 --- a/protocols/msn/ns.c +++ b/protocols/msn/ns.c @@ -33,7 +33,7 @@ static gboolean msn_ns_callback( gpointer data, gint source, b_input_condition c static int msn_ns_command( gpointer data, char **cmd, int num_parts ); static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ); -static void msn_auth_got_passport_token( struct msn_auth_data *mad ); +static void msn_auth_got_passport_id( struct passport_reply *rep ); gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) { @@ -221,7 +221,7 @@ static int msn_ns_command( gpointer data, char **cmd, int num_parts ) if( num_parts == 5 && strcmp( cmd[2], "TWN" ) == 0 && strcmp( cmd[3], "S" ) == 0 ) { /* Time for some Passport black magic... */ - if( !passport_get_token( msn_auth_got_passport_token, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) + if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) { imcb_error( ic, "Error while contacting Passport server" ); imc_logout( ic, TRUE ); @@ -708,26 +708,22 @@ static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int return( 1 ); } -static void msn_auth_got_passport_token( struct msn_auth_data *mad ) +static void msn_auth_got_passport_id( struct passport_reply *rep ) { - struct im_connection *ic = mad->data; - struct msn_data *md; - - /* Dead connection? */ - if( g_slist_find( msn_connections, ic ) == NULL ) - return; + struct im_connection *ic = rep->data; + struct msn_data *md = ic->proto_data; + char *key = rep->result; + char buf[1024]; - md = ic->proto_data; - if( mad->token ) + if( key == NULL ) { - char buf[1024]; - - g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, mad->token ); - msn_write( ic, buf, strlen( buf ) ); + imcb_error( ic, "Error during Passport authentication (%s)", + rep->error_string ? rep->error_string : "Unknown error" ); + imc_logout( ic, TRUE ); } else { - imcb_error( ic, "Error during Passport authentication: %s", mad->error ); - imc_logout( ic, TRUE ); + g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key ); + msn_write( ic, buf, strlen( buf ) ); } } |