Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    re6648bf r8ff0a61  
    3434static int msn_ns_message( gpointer data, char *msg, int msglen, char **cmd, int num_parts );
    3535
    36 static void msn_auth_got_passport_token( struct msn_auth_data *mad );
     36static void msn_auth_got_passport_id( struct passport_reply *rep );
    3737
    3838gboolean msn_ns_connected( gpointer data, gint source, b_input_condition cond )
     
    214214                {
    215215                        /* Time for some Passport black magic... */
    216                         if( !passport_get_token( msn_auth_got_passport_token, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )
     216                        if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )
    217217                        {
    218218                                imcb_error( ic, "Error while contacting Passport server" );
     
    674674}
    675675
    676 static void msn_auth_got_passport_token( struct msn_auth_data *mad )
     676static void msn_auth_got_passport_id( struct passport_reply *rep )
    677677{
    678         struct im_connection *ic = mad->data;
    679         struct msn_data *md;
    680        
    681         /* Dead connection? */
    682         if( g_slist_find( msn_connections, ic ) == NULL )
    683                 return;
    684        
    685         md = ic->proto_data;
    686         if( mad->token )
    687         {
    688                 char buf[1024];
    689                
    690                 g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, mad->token );
     678        struct im_connection *ic = rep->data;
     679        struct msn_data *md = ic->proto_data;
     680        char *key = rep->result;
     681        char buf[1024];
     682       
     683        if( key == NULL )
     684        {
     685                imcb_error( ic, "Error during Passport authentication (%s)",
     686                               rep->error_string ? rep->error_string : "Unknown error" );
     687                imc_logout( ic, TRUE );
     688        }
     689        else
     690        {
     691                g_snprintf( buf, sizeof( buf ), "USR %d TWN S %s\r\n", ++md->trId, key );
    691692                msn_write( ic, buf, strlen( buf ) );
    692693        }
    693         else
    694         {
    695                 imcb_error( ic, "Error during Passport authentication: %s", mad->error );
    696                 imc_logout( ic, TRUE );
    697         }
    698694}
Note: See TracChangeset for help on using the changeset viewer.