Changeset devel,411 for devel/protocols/msn/ns.c
- Timestamp:
- 2008-07-31T20:44:43Z (2 years ago)
- branch-nick:
- devel
- revision id:
- wilmer@gaast.net-20080731204443-lvon6xxb8erdw240
- Files:
-
- 1 modified
-
devel/protocols/msn/ns.c (modified) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
devel/protocols/msn/ns.c
r405 r411 34 34 static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts ); 35 35 36 static void msn_auth_got_passport_ token( struct msn_auth_data *mad);36 static void msn_auth_got_passport_id( struct passport_reply *rep ); 37 37 38 38 gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond ) … … 222 222 { 223 223 /* Time for some Passport black magic... */ 224 if( !passport_get_ token( msn_auth_got_passport_token, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )224 if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) ) 225 225 { 226 226 imcb_error( ic, "Error while contacting Passport server" ); … … 709 709 } 710 710 711 static void msn_auth_got_passport_ token( struct msn_auth_data *mad)711 static void msn_auth_got_passport_id( struct passport_reply *rep ) 712 712 { 713 struct im_connection *ic = mad->data; 714 struct msn_data *md; 715 716 /* Dead connection? */ 717 if( g_slist_find( msn_connections, ic ) == NULL ) 718 return; 719 720 md = ic->proto_data; 721 if( mad->token ) 722 { 723 char buf[1024]; 724 725 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, mad->token ); 713 struct im_connection *ic = rep->data; 714 struct msn_data *md = ic->proto_data; 715 char *key = rep->result; 716 char buf[1024]; 717 718 if( key == NULL ) 719 { 720 imcb_error( ic, "Error during Passport authentication (%s)", 721 rep->error_string ? rep->error_string : "Unknown error" ); 722 imc_logout( ic, TRUE ); 723 } 724 else 725 { 726 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key ); 726 727 msn_write( ic, buf, strlen( buf ) ); 727 728 } 728 else729 {730 imcb_error( ic, "Error during Passport authentication: %s", mad->error );731 imc_logout( ic, TRUE );732 }733 729 }
