Ignore:
Timestamp:
2007-04-06T05:20:31Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
552e641
Parents:
0da65d5
Message:

More cleanups, mainly in the callbacks. Replaced things like
do_error_dialog() and (set|hide)_login_progress(_error)?() with things
that hopefully make more sense.

Although it's still not really great...

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    r0da65d5 raef4828  
    117117                jd->fd = -1;
    118118               
    119                 hide_login_progress_error( ic, "Short write() to server" );
    120                 signoff( ic );
     119                imc_error( ic, "Short write() to server" );
     120                imc_logout( ic );
    121121                return FALSE;
    122122        }
     
    160160                if( xt_feed( jd->xt, buf, st ) < 0 )
    161161                {
    162                         hide_login_progress_error( ic, "XML stream error" );
    163                         signoff( ic );
     162                        imc_error( ic, "XML stream error" );
     163                        imc_logout( ic );
    164164                        return FALSE;
    165165                }
     
    203203                                        if( set_getbool( &ic->acc->set, "tls" ) )
    204204                                        {
    205                                                 hide_login_progress( ic, "TLS is turned on for this "
     205                                                imc_error( ic, "TLS is turned on for this "
    206206                                                          "account, but is not supported by this server" );
    207                                                 signoff( ic );
     207                                                imc_logout( ic );
    208208                                                return FALSE;
    209209                                        }
     
    216216                        else
    217217                        {
    218                                 hide_login_progress( ic, "XML stream error" );
    219                                 signoff( ic );
     218                                imc_error( ic, "XML stream error" );
     219                                imc_logout( ic );
    220220                                return FALSE;
    221221                        }
     
    227227                jd->fd = -1;
    228228               
    229                 hide_login_progress_error( ic, "Error while reading from server" );
    230                 signoff( ic );
     229                imc_error( ic, "Error while reading from server" );
     230                imc_logout( ic );
    231231                return FALSE;
    232232        }
     
    242242        if( source == -1 )
    243243        {
    244                 hide_login_progress( ic, "Could not connect to server" );
    245                 signoff( ic );
     244                imc_error( ic, "Could not connect to server" );
     245                imc_logout( ic );
    246246                return FALSE;
    247247        }
    248248       
    249         set_login_progress( ic, 1, "Connected to server, logging in" );
     249        imc_log( ic, "Connected to server, logging in" );
    250250       
    251251        return jabber_start_stream( ic );
     
    263263                jd->ssl = NULL;
    264264               
    265                 hide_login_progress( ic, "Could not connect to server" );
    266                 signoff( ic );
     265                imc_error( ic, "Could not connect to server" );
     266                imc_logout( ic );
    267267                return FALSE;
    268268        }
    269269       
    270         set_login_progress( ic, 1, "Connected to server, logging in" );
     270        imc_log( ic, "Connected to server, logging in" );
    271271       
    272272        return jabber_start_stream( ic );
     
    275275static xt_status jabber_end_of_stream( struct xt_node *node, gpointer data )
    276276{
    277         signoff( data );
     277        imc_logout( data );
    278278        return XT_ABORT;
    279279}
     
    297297                if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )
    298298                {
    299                         hide_login_progress( ic, "Server requires TLS connections, but TLS is turned off for this account" );
    300                         signoff( ic );
     299                        imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
     300                        imc_logout( ic );
    301301                       
    302302                        return XT_ABORT;
     
    327327                if( !trytls && set_getbool( &ic->acc->set, "tls" ) )
    328328                {
    329                         hide_login_progress( ic, "TLS is turned on for this account, but is not supported by this server" );
    330                         signoff( ic );
     329                        imc_error( ic, "TLS is turned on for this account, but is not supported by this server" );
     330                        imc_logout( ic );
    331331                       
    332332                        return XT_ABORT;
     
    417417        jd->w_inpa = jd->r_inpa = 0;
    418418       
    419         set_login_progress( ic, 1, "Converting stream to TLS" );
     419        imc_log( ic, "Converting stream to TLS" );
    420420       
    421421        jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic );
     
    452452        if( type == NULL )
    453453        {
    454                 hide_login_progress_error( ic, "Unknown stream error reported by server" );
    455                 signoff( ic );
     454                imc_error( ic, "Unknown stream error reported by server" );
     455                imc_logout( ic );
    456456                return XT_ABORT;
    457457        }
     
    462462        if( strcmp( type, "conflict" ) == 0 )
    463463        {
    464                 hide_login_progress( ic, "Account and resource used from a different location" );
     464                imc_error( ic, "Account and resource used from a different location" );
    465465                ic->wants_to_die = TRUE;
    466466        }
     
    468468        {
    469469                s = g_strdup_printf( "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
    470                 hide_login_progress_error( ic, s );
     470                imc_error( ic, s );
    471471                g_free( s );
    472472        }
    473473       
    474         signoff( ic );
     474        imc_logout( ic );
    475475       
    476476        return XT_ABORT;
Note: See TracChangeset for help on using the changeset viewer.