Changeset aef4828


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...

Files:
25 edited

Legend:

Unmodified
Added
Removed
  • account.c

    r0da65d5 raef4828  
    224224{
    225225        a->ic->wants_to_die = TRUE;
    226         signoff( a->ic );
     226        imc_logout( a->ic );
    227227        a->ic = NULL;
    228228        if( a->reconnect )
  • irc.c

    r0da65d5 raef4828  
    232232                if (account->ic) {
    233233                        account->ic->wants_to_die = TRUE;
    234                         signoff(account->ic);
     234                        imc_logout(account->ic);
    235235                } else if (account->reconnect) {
    236236                        cancel_auto_reconnect(account);
  • 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;
  • protocols/jabber/iq.c

    r0da65d5 raef4828  
    3939        if( !type )
    4040        {
    41                 hide_login_progress_error( ic, "Received IQ packet without type." );
    42                 signoff( ic );
     41                imc_error( ic, "Received IQ packet without type." );
     42                imc_logout( ic );
    4343                return XT_ABORT;
    4444        }
     
    6060               
    6161                if( entry == NULL )
    62                         serv_got_crap( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
     62                        imc_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
    6363                else if( entry->func )
    6464                        return entry->func( ic, node, entry->node );
     
    6969                    !( s = xt_find_attr( c, "xmlns" ) ) )
    7070                {
    71                         serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );
     71                        imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
    7272                        return XT_HANDLED;
    7373                }
     
    132132                    !( s = xt_find_attr( c, "xmlns" ) ) )
    133133                {
    134                         serv_got_crap( ic, "WARNING: Received incomplete IQ-%s packet", type );
     134                        imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
    135135                        return XT_HANDLED;
    136136                }
     
    154154                        else
    155155                        {
    156                                 serv_got_crap( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
     156                                imc_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
    157157                               
    158158                                xt_free_node( reply );
     
    219219        if( !( query = xt_find_node( node->children, "query" ) ) )
    220220        {
    221                 serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    222                 signoff( ic );
     221                imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
     222                imc_logout( ic );
    223223                return XT_HANDLED;
    224224        }
     
    258258                xt_free_node( reply );
    259259               
    260                 hide_login_progress( ic, "Can't find suitable authentication method" );
    261                 signoff( ic );
     260                imc_error( ic, "Can't find suitable authentication method" );
     261                imc_logout( ic );
    262262                return XT_ABORT;
    263263        }
     
    277277        if( !( type = xt_find_attr( node, "type" ) ) )
    278278        {
    279                 serv_got_crap( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    280                 signoff( ic );
     279                imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
     280                imc_logout( ic );
    281281                return XT_HANDLED;
    282282        }
     
    284284        if( strcmp( type, "error" ) == 0 )
    285285        {
    286                 hide_login_progress( ic, "Authentication failure" );
    287                 signoff( ic );
     286                imc_error( ic, "Authentication failure" );
     287                imc_logout( ic );
    288288                return XT_ABORT;
    289289        }
     
    311311                if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
    312312                    strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
    313                         serv_got_crap( ic, "Server changed session resource string to `%s'", s + 1 );
     313                        imc_log( ic, "Server changed session resource string to `%s'", s + 1 );
    314314               
    315315                jd->flags &= ~JFLAG_WAIT_BIND;
     
    334334        int st;
    335335       
    336         set_login_progress( ic, 1, "Authenticated, requesting buddy list" );
     336        imc_log( ic, "Authenticated, requesting buddy list" );
    337337       
    338338        node = xt_new_node( "query", NULL, NULL );
     
    353353        if( !( query = xt_find_node( node->children, "query" ) ) )
    354354        {
    355                 serv_got_crap( ic, "WARNING: Received NULL roster packet" );
     355                imc_log( ic, "WARNING: Received NULL roster packet" );
    356356                return XT_HANDLED;
    357357        }
     
    397397       
    398398        if( initial )
    399                 account_online( ic );
     399                imc_connected( ic );
    400400       
    401401        return XT_HANDLED;
     
    428428        {
    429429                s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */
    430                 serv_got_crap( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
     430                imc_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
    431431                return XT_HANDLED;
    432432        }
     
    536536        /* *sigh* */
    537537       
    538         serv_got_crap( ic, reply->str );
     538        imc_log( ic, reply->str );
    539539        g_string_free( reply, TRUE );
    540540       
  • protocols/jabber/jabber.c

    r0da65d5 raef4828  
    5959static void jabber_login( account_t *acc )
    6060{
    61         struct im_connection *ic = new_gaim_conn( acc );
     61        struct im_connection *ic = imc_new( acc );
    6262        struct jabber_data *jd = g_new0( struct jabber_data, 1 );
    6363        struct ns_srv_reply *srv = NULL;
     
    7272        if( jd->server == NULL )
    7373        {
    74                 hide_login_progress( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
    75                 signoff( ic );
     74                imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
     75                imc_logout( ic );
    7676                return;
    7777        }
     
    159159                connect_to = jd->server;
    160160       
    161         set_login_progress( ic, 0, "Connecting" );
     161        imc_log( ic, "Connecting" );
    162162       
    163163        if( set_getint( &acc->set, "port" ) < JABBER_PORT_MIN ||
    164164            set_getint( &acc->set, "port" ) > JABBER_PORT_MAX )
    165165        {
    166                 serv_got_crap( ic, "Incorrect port number, must be in the %d-%d range",
     166                imc_log( ic, "Incorrect port number, must be in the %d-%d range",
    167167                               JABBER_PORT_MIN, JABBER_PORT_MAX );
    168                 signoff( ic );
     168                imc_logout( ic );
    169169                return;
    170170        }
     
    186186        if( jd->fd == -1 )
    187187        {
    188                 hide_login_progress( ic, "Could not connect to server" );
    189                 signoff( ic );
     188                imc_error( ic, "Could not connect to server" );
     189                imc_logout( ic );
    190190        }
    191191}
     
    285285        while( bud )
    286286        {
    287                 serv_got_crap( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
     287                imc_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
    288288                                   bud->full_jid, bud->priority,
    289289                                   bud->away_state ? bud->away_state->full_name : "(none)",
  • protocols/jabber/presence.c

    r0da65d5 raef4828  
    4141                {
    4242                        if( set_getbool( &ic->irc->set, "debug" ) )
    43                                 serv_got_crap( ic, "WARNING: Could not handle presence information from JID: %s", from );
     43                                imc_log( ic, "WARNING: Could not handle presence information from JID: %s", from );
    4444                        return XT_HANDLED;
    4545                }
     
    7474                {
    7575                        if( set_getbool( &ic->irc->set, "debug" ) )
    76                                 serv_got_crap( ic, "WARNING: Received presence information from unknown JID: %s", from );
     76                                imc_log( ic, "WARNING: Received presence information from unknown JID: %s", from );
    7777                        return XT_HANDLED;
    7878                }
     
    103103        {
    104104                /* Not sure about this one, actually... */
    105                 serv_got_crap( ic, "%s just accepted your authorization request", from );
     105                imc_log( ic, "%s just accepted your authorization request", from );
    106106        }
    107107        else if( strcmp( type, "unsubscribe" ) == 0 || strcmp( type, "unsubscribed" ) == 0 )
  • protocols/jabber/sasl.c

    r0da65d5 raef4828  
    3838                   IQ authentication. Strange things happen when you try
    3939                   to do both... */
    40                 serv_got_crap( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
     40                imc_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
    4141                return XT_HANDLED;
    4242        }
     
    4545        if( !s || strcmp( s, XMLNS_SASL ) != 0 )
    4646        {
    47                 signoff( ic );
     47                imc_logout( ic );
    4848                return XT_ABORT;
    4949        }
     
    6262        if( !sup_plain && !sup_digest )
    6363        {
    64                 hide_login_progress( ic, "No known SASL authentication schemes supported" );
    65                 signoff( ic );
     64                imc_error( ic, "No known SASL authentication schemes supported" );
     65                imc_logout( ic );
    6666                return XT_ABORT;
    6767        }
     
    279279
    280280error:
    281         hide_login_progress( ic, "Incorrect SASL challenge received" );
    282         signoff( ic );
     281        imc_error( ic, "Incorrect SASL challenge received" );
     282        imc_logout( ic );
    283283
    284284silent_error:
     
    303303        if( !s || strcmp( s, XMLNS_SASL ) != 0 )
    304304        {
    305                 signoff( ic );
     305                imc_logout( ic );
    306306                return XT_ABORT;
    307307        }
     
    309309        if( strcmp( node->name, "success" ) == 0 )
    310310        {
    311                 set_login_progress( ic, 1, "Authentication finished" );
     311                imc_log( ic, "Authentication finished" );
    312312                jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART;
    313313        }
    314314        else if( strcmp( node->name, "failure" ) == 0 )
    315315        {
    316                 hide_login_progress( ic, "Authentication failure" );
    317                 signoff( ic );
     316                imc_error( ic, "Authentication failure" );
     317                imc_logout( ic );
    318318                return XT_ABORT;
    319319        }
  • protocols/msn/msn.c

    r0da65d5 raef4828  
    3939static void msn_login( account_t *acc )
    4040{
    41         struct im_connection *ic = new_gaim_conn( acc );
     41        struct im_connection *ic = imc_new( acc );
    4242        struct msn_data *md = g_new0( struct msn_data, 1 );
    4343       
     
    4747        if( strchr( acc->user, '@' ) == NULL )
    4848        {
    49                 hide_login_progress( ic, "Invalid account name" );
    50                 signoff( ic );
     49                imc_error( ic, "Invalid account name" );
     50                imc_logout( ic );
    5151                return;
    5252        }
    5353       
    54         set_login_progress( ic, 1, "Connecting" );
     54        imc_log( ic, "Connecting" );
    5555       
    5656        md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic );
    5757        if( md->fd < 0 )
    5858        {
    59                 hide_login_progress( ic, "Could not connect to server" );
    60                 signoff( ic );
     59                imc_error( ic, "Could not connect to server" );
     60                imc_logout( ic );
    6161                return;
    6262        }
     
    9696                                m = l->data;
    9797                       
    98                                 serv_got_crap( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
     98                                imc_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
    9999                                g_free( m->who );
    100100                                g_free( m->text );
     
    228228{
    229229        /* Just make an URL and let the user fetch the info */
    230         serv_got_crap( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );
     230        imc_log( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );
    231231}
    232232
     
    373373        if( strlen( value ) > 129 )
    374374        {
    375                 serv_got_crap( ic, "Maximum name length exceeded" );
     375                imc_log( ic, "Maximum name length exceeded" );
    376376                return NULL;
    377377        }
  • protocols/msn/msn_util.c

    r0da65d5 raef4828  
    3636        if( st != len )
    3737        {
    38                 hide_login_progress_error( ic, "Short write() to main server" );
    39                 signoff( ic );
     38                imc_error( ic, "Short write() to main server" );
     39                imc_logout( ic );
    4040                return( 0 );
    4141        }
     
    4646int msn_logged_in( struct im_connection *ic )
    4747{
    48         account_online( ic );
     48        imc_connected( ic );
    4949       
    5050        return( 0 );
  • protocols/msn/ns.c

    r0da65d5 raef4828  
    4747        if( source == -1 )
    4848        {
    49                 hide_login_progress( ic, "Could not connect to server" );
    50                 signoff( ic );
     49                imc_error( ic, "Could not connect to server" );
     50                imc_logout( ic );
    5151                return FALSE;
    5252        }
     
    7676        {
    7777                ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic );
    78                 set_login_progress( ic, 1, "Connected to server, waiting for reply" );
     78                imc_log( ic, "Connected to server, waiting for reply" );
    7979        }
    8080       
     
    8989        if( msn_handler( md->handler ) == -1 ) /* Don't do this on ret == 0, it's already done then. */
    9090        {
    91                 hide_login_progress( ic, "Error while reading from server" );
    92                 signoff( ic );
     91                imc_error( ic, "Error while reading from server" );
     92                imc_logout( ic );
    9393               
    9494                return FALSE;
     
    114114                if( cmd[2] && strncmp( cmd[2], "MSNP8", 5 ) != 0 )
    115115                {
    116                         hide_login_progress( ic, "Unsupported protocol" );
    117                         signoff( ic );
     116                        imc_error( ic, "Unsupported protocol" );
     117                        imc_logout( ic );
    118118                        return( 0 );
    119119                }
     
    143143                        if( !server )
    144144                        {
    145                                 hide_login_progress_error( ic, "Syntax error" );
    146                                 signoff( ic );
     145                                imc_error( ic, "Syntax error" );
     146                                imc_logout( ic );
    147147                                return( 0 );
    148148                        }
     
    151151                        server = cmd[3];
    152152                       
    153                         set_login_progress( ic, 1, "Transferring to other server" );
     153                        imc_log( ic, "Transferring to other server" );
    154154                       
    155155                        md->fd = proxy_connect( server, port, msn_ns_connected, ic );
     
    162162                        if( !server )
    163163                        {
    164                                 hide_login_progress_error( ic, "Syntax error" );
    165                                 signoff( ic );
     164                                imc_error( ic, "Syntax error" );
     165                                imc_logout( ic );
    166166                                return( 0 );
    167167                        }
     
    172172                        if( strcmp( cmd[4], "CKI" ) != 0 )
    173173                        {
    174                                 hide_login_progress_error( ic, "Unknown authentication method for switchboard" );
    175                                 signoff( ic );
     174                                imc_error( ic, "Unknown authentication method for switchboard" );
     175                                imc_logout( ic );
    176176                                return( 0 );
    177177                        }
     
    204204                else
    205205                {
    206                         hide_login_progress_error( ic, "Syntax error" );
    207                         signoff( ic );
     206                        imc_error( ic, "Syntax error" );
     207                        imc_logout( ic );
    208208                        return( 0 );
    209209                }
     
    216216                        if( !passport_get_id( msn_auth_got_passport_id, ic, ic->username, ic->password, cmd[4] ) )
    217217                        {
    218                                 hide_login_progress_error( ic, "Error while contacting Passport server" );
    219                                 signoff( ic );
     218                                imc_error( ic, "Error while contacting Passport server" );
     219                                imc_logout( ic );
    220220                                return( 0 );
    221221                        }
     
    236236                        }
    237237                       
    238                         set_login_progress( ic, 1, "Authenticated, getting buddy list" );
     238                        imc_log( ic, "Authenticated, getting buddy list" );
    239239                       
    240240                        g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId );
     
    243243                else
    244244                {
    245                         hide_login_progress( ic, "Unknown authentication type" );
    246                         signoff( ic );
     245                        imc_error( ic, "Unknown authentication type" );
     246                        imc_logout( ic );
    247247                        return( 0 );
    248248                }
     
    252252                if( num_parts != 4 )
    253253                {
    254                         hide_login_progress_error( ic, "Syntax error" );
    255                         signoff( ic );
     254                        imc_error( ic, "Syntax error" );
     255                        imc_logout( ic );
    256256                        return( 0 );
    257257                }
     
    261261                if( md->handler->msglen <= 0 )
    262262                {
    263                         hide_login_progress_error( ic, "Syntax error" );
    264                         signoff( ic );
     263                        imc_error( ic, "Syntax error" );
     264                        imc_logout( ic );
    265265                        return( 0 );
    266266                }
     
    292292                if( num_parts != 4 && num_parts != 5 )
    293293                {
    294                         hide_login_progress( ic, "Syntax error" );
    295                         signoff( ic );
     294                        imc_error( ic, "Syntax error" );
     295                        imc_logout( ic );
    296296                        return( 0 );
    297297                }
     
    328328                        if( ic->flags & OPT_LOGGED_IN )
    329329                        {
    330                                 serv_got_crap( ic, "Successfully transferred to different server" );
     330                                imc_log( ic, "Successfully transferred to different server" );
    331331                                g_snprintf( buf, sizeof( buf ), "CHG %d %s %d\r\n", ++md->trId, md->away_state->code, 0 );
    332332                                return( msn_write( ic, buf, strlen( buf ) ) );
     
    344344                if( num_parts != 4 )
    345345                {
    346                         hide_login_progress_error( ic, "Syntax error" );
    347                         signoff( ic );
     346                        imc_error( ic, "Syntax error" );
     347                        imc_logout( ic );
    348348                        return( 0 );
    349349                }
     
    363363                if( num_parts != 3 )
    364364                {
    365                         hide_login_progress_error( ic, "Syntax error" );
    366                         signoff( ic );
     365                        imc_error( ic, "Syntax error" );
     366                        imc_logout( ic );
    367367                        return( 0 );
    368368                }
     
    385385                if( num_parts != 6 )
    386386                {
    387                         hide_login_progress_error( ic, "Syntax error" );
    388                         signoff( ic );
     387                        imc_error( ic, "Syntax error" );
     388                        imc_logout( ic );
    389389                        return( 0 );
    390390                }
     
    413413                if( num_parts != 5 )
    414414                {
    415                         hide_login_progress_error( ic, "Syntax error" );
    416                         signoff( ic );
     415                        imc_error( ic, "Syntax error" );
     416                        imc_logout( ic );
    417417                        return( 0 );
    418418                }
     
    438438                if( num_parts != 7 )
    439439                {
    440                         hide_login_progress_error( ic, "Syntax error" );
    441                         signoff( ic );
     440                        imc_error( ic, "Syntax error" );
     441                        imc_logout( ic );
    442442                        return( 0 );
    443443                }
     
    448448                if( !server )
    449449                {
    450                         hide_login_progress_error( ic, "Syntax error" );
    451                         signoff( ic );
     450                        imc_error( ic, "Syntax error" );
     451                        imc_logout( ic );
    452452                        return( 0 );
    453453                }
     
    458458                if( strcmp( cmd[3], "CKI" ) != 0 )
    459459                {
    460                         hide_login_progress_error( ic, "Unknown authentication method for switchboard" );
    461                         signoff( ic );
     460                        imc_error( ic, "Unknown authentication method for switchboard" );
     461                        imc_logout( ic );
    462462                        return( 0 );
    463463                }
     
    478478                        if( strchr( cmd[4], '@' ) == NULL )
    479479                        {
    480                                 hide_login_progress_error( ic, "Syntax error" );
    481                                 signoff( ic );
     480                                imc_error( ic, "Syntax error" );
     481                                imc_logout( ic );
    482482                                return( 0 );
    483483                        }
     
    499499                if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 )
    500500                {
    501                         hide_login_progress_error( ic, "Someone else logged in with your account" );
     501                        imc_error( ic, "Someone else logged in with your account" );
    502502                        ic->wants_to_die = 1;
    503503                }
    504504                else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 )
    505505                {
    506                         hide_login_progress_error( ic, "Terminating session because of server shutdown" );
     506                        imc_error( ic, "Terminating session because of server shutdown" );
    507507                }
    508508                else
    509509                {
    510                         hide_login_progress_error( ic, "Session terminated by remote server (reason unknown)" );
    511                 }
    512                
    513                 signoff( ic );
     510                        imc_error( ic, "Session terminated by remote server (reason unknown)" );
     511                }
     512               
     513                imc_logout( ic );
    514514                return( 0 );
    515515        }
     
    518518                if( num_parts != 5 )
    519519                {
    520                         hide_login_progress_error( ic, "Syntax error" );
    521                         signoff( ic );
     520                        imc_error( ic, "Syntax error" );
     521                        imc_logout( ic );
    522522                        return( 0 );
    523523                }
     
    546546        else if( strcmp( cmd[0], "IPG" ) == 0 )
    547547        {
    548                 do_error_dialog( ic, "Received IPG command, we don't handle them yet.", "MSN" );
     548                imc_error( ic, "Received IPG command, we don't handle them yet." );
    549549               
    550550                md->handler->msglen = atoi( cmd[1] );
     
    552552                if( md->handler->msglen <= 0 )
    553553                {
    554                         hide_login_progress_error( ic, "Syntax error" );
    555                         signoff( ic );
     554                        imc_error( ic, "Syntax error" );
     555                        imc_logout( ic );
    556556                        return( 0 );
    557557                }
     
    562562                const struct msn_status_code *err = msn_status_by_number( num );
    563563               
    564                 g_snprintf( buf, sizeof( buf ), "Error reported by MSN server: %s", err->text );
    565                 do_error_dialog( ic, buf, "MSN" );
     564                imc_error( ic, "Error reported by MSN server: %s", err->text );
    566565               
    567566                if( err->flags & STATUS_FATAL )
    568567                {
    569                         signoff( ic );
     568                        imc_logout( ic );
    570569                        return( 0 );
    571570                }
     
    617616                                {
    618617                                        if( arg1 )
    619                                                 serv_got_crap( ic, "The server is going down for maintenance in %s minutes.", arg1 );
     618                                                imc_log( ic, "The server is going down for maintenance in %s minutes.", arg1 );
    620619                                }
    621620                               
     
    634633                                if( inbox && folders )
    635634                                {
    636                                         serv_got_crap( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
     635                                        imc_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
    637636                                }
    638637                        }
     
    644643                                if( from && fromname )
    645644                                {
    646                                         serv_got_crap( ic, "Received an e-mail message from %s <%s>.", fromname, from );
     645                                        imc_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
    647646                                }
    648647                        }
     
    677676                                       rep->error_string ? rep->error_string : "Unknown error" );
    678677               
    679                 hide_login_progress( ic, err );
    680                 signoff( ic );
     678                imc_error( ic, err );
     679                imc_logout( ic );
    681680               
    682681                g_free( err );
  • protocols/msn/sb.c

    r0da65d5 raef4828  
    222222                g_slist_free( sb->msgq );
    223223               
    224                 serv_got_crap( ic, "Warning: Closing down MSN switchboard connection with "
     224                imc_log( ic, "Warning: Closing down MSN switchboard connection with "
    225225                                   "unsent message to %s, you'll have to resend it.",
    226226                                   sb->who ? sb->who : "(unknown)" );
     
    321321        if( strcmp( cmd[0], "XFR" ) == 0 )
    322322        {
    323                 hide_login_progress_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
    324                 signoff( ic );
     323                imc_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
     324                imc_logout( ic );
    325325                return( 0 );
    326326        }
     
    528528                const struct msn_status_code *err = msn_status_by_number( num );
    529529               
    530                 g_snprintf( buf, sizeof( buf ), "Error reported by switchboard server: %s", err->text );
    531                 do_error_dialog( ic, buf, "MSN" );
     530                imc_error( ic, "Error reported by switchboard server: %s", err->text );
    532531               
    533532                if( err->flags & STATUS_SB_FATAL )
     
    538537                else if( err->flags & STATUS_FATAL )
    539538                {
    540                         signoff( ic );
     539                        imc_logout( ic );
    541540                        return 0;
    542541                }
  • protocols/nogaim.c

    r0da65d5 raef4828  
    145145/* multi.c */
    146146
    147 struct im_connection *new_gaim_conn( account_t *acc )
     147struct im_connection *imc_new( account_t *acc )
    148148{
    149149        struct im_connection *ic;
     
    164164}
    165165
    166 void destroy_gaim_conn( struct im_connection *ic )
     166void imc_free( struct im_connection *ic )
    167167{
    168168        account_t *a;
     
    180180}
    181181
    182 void set_login_progress( struct im_connection *ic, int step, char *msg )
    183 {
    184         serv_got_crap( ic, "Logging in: %s", msg );
    185 }
    186 
    187 /* Errors *while* logging in */
    188 void hide_login_progress( struct im_connection *ic, char *msg )
    189 {
    190         serv_got_crap( ic, "Login error: %s", msg );
    191 }
    192 
    193 /* Errors *after* logging in */
    194 void hide_login_progress_error( struct im_connection *ic, char *msg )
    195 {
    196         serv_got_crap( ic, "Logged out: %s", msg );
    197 }
    198 
    199 void serv_got_crap( struct im_connection *ic, char *format, ... )
     182static void serv_got_crap( struct im_connection *ic, char *format, ... )
    200183{
    201184        va_list params;
     
    225208}
    226209
     210void imc_log( struct im_connection *ic, char *format, ... )
     211{
     212        va_list params;
     213        char *text;
     214       
     215        va_start( params, format );
     216        text = g_strdup_vprintf( format, params );
     217        va_end( params );
     218       
     219        if( ic->flags & OPT_LOGGED_IN )
     220                serv_got_crap( ic, "%s", text );
     221        else
     222                serv_got_crap( ic, "Logging in: %s", text );
     223       
     224        g_free( text );
     225}
     226
     227void imc_error( struct im_connection *ic, char *format, ... )
     228{
     229        va_list params;
     230        char *text;
     231       
     232        va_start( params, format );
     233        text = g_strdup_vprintf( format, params );
     234        va_end( params );
     235       
     236        if( ic->flags & OPT_LOGGED_IN )
     237                serv_got_crap( ic, "Error: %s", text );
     238        else
     239                serv_got_crap( ic, "Couldn't log in: %s", text );
     240       
     241        g_free( text );
     242}
     243
    227244static gboolean send_keepalive( gpointer d, gint fd, b_input_condition cond )
    228245{
     
    235252}
    236253
    237 void account_online( struct im_connection *ic )
     254void imc_connected( struct im_connection *ic )
    238255{
    239256        user_t *u;
     
    247264        u = user_find( ic->irc, ic->irc->nick );
    248265       
    249         serv_got_crap( ic, "Logged in" );
     266        imc_log( ic, "Logged in" );
    250267       
    251268        ic->keepalive = b_timeout_add( 60000, send_keepalive, ic );
     
    274291}
    275292
    276 void signoff( struct im_connection *ic )
     293void imc_logout( struct im_connection *ic )
    277294{
    278295        irc_t *irc = ic->irc;
     
    287304                ic->flags |= OPT_LOGGING_OUT;
    288305       
    289         serv_got_crap( ic, "Signing off.." );
     306        imc_log( ic, "Signing off.." );
    290307       
    291308        b_event_remove( ic->keepalive );
     
    321338                int delay = set_getint( &irc->set, "auto_reconnect_delay" );
    322339               
    323                 serv_got_crap( ic, "Reconnecting in %d seconds..", delay );
     340                imc_log( ic, "Reconnecting in %d seconds..", delay );
    324341                a->reconnect = b_timeout_add( delay * 1000, auto_reconnect, a );
    325342        }
    326343       
    327         destroy_gaim_conn( ic );
     344        imc_free( ic );
    328345}
    329346
    330347
    331348/* dialogs.c */
    332 
    333 void do_error_dialog( struct im_connection *ic, char *msg, char *title )
    334 {
    335         if( msg && title )
    336                 serv_got_crap( ic, "Error: %s: %s", title, msg );
    337         else if( msg )
    338                 serv_got_crap( ic, "Error: %s", msg );
    339         else if( title )
    340                 serv_got_crap( ic, "Error: %s", title );
    341         else
    342                 serv_got_crap( ic, "Error" );
    343 }
    344349
    345350void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont )
     
    359364       
    360365        if( set_getbool( &irc->set, "debug" ) && 0 ) /* This message is too useless */
    361                 serv_got_crap( ic, "Receiving user add from handle: %s", handle );
     366                imc_log( ic, "Receiving user add from handle: %s", handle );
    362367       
    363368        if( user_findhandle( ic, handle ) )
    364369        {
    365370                if( set_getbool( &irc->set, "debug" ) )
    366                         serv_got_crap( ic, "User already exists, ignoring add request: %s", handle );
     371                        imc_log( ic, "User already exists, ignoring add request: %s", handle );
    367372               
    368373                return;
     
    452457               
    453458                if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) )
    454                         serv_got_crap( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
     459                        imc_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
    455460        }
    456461}
     
    516521                        if( set_getbool( &ic->irc->set, "debug" ) || g_strcasecmp( set_getstr( &ic->irc->set, "handle_unknown" ), "ignore" ) != 0 )
    517522                        {
    518                                 serv_got_crap( ic, "serv_got_update() for handle %s:", handle );
    519                                 serv_got_crap( ic, "loggedin = %d, type = %d", loggedin, type );
     523                                imc_log( ic, "serv_got_update() for handle %s:", handle );
     524                                imc_log( ic, "loggedin = %d, type = %d", loggedin, type );
    520525                        }
    521526                       
     
    597602                {
    598603                        if( set_getbool( &irc->set, "debug" ) )
    599                                 serv_got_crap( ic, "Ignoring message from unknown handle %s", handle );
     604                                imc_log( ic, "Ignoring message from unknown handle %s", handle );
    600605                       
    601606                        return;
     
    619624                else
    620625                {
    621                         serv_got_crap( ic, "Message from unknown handle %s:", handle );
     626                        imc_log( ic, "Message from unknown handle %s:", handle );
    622627                        u = user_find( irc, irc->mynick );
    623628                }
     
    689694       
    690695        if( set_getbool( &ic->irc->set, "debug" ) )
    691                 serv_got_crap( ic, "You were removed from conversation 0x%x", (int) c );
     696                imc_log( ic, "You were removed from conversation 0x%x", (int) c );
    692697       
    693698        if( c )
     
    737742                irc_privmsg( ic->irc, u, "PRIVMSG", c->channel, "", msg );
    738743        else
    739                 serv_got_crap( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
     744                imc_log( ic, "Message from/to conversation %s@0x%x (unknown conv/user): %s", who, (int) c, msg );
    740745}
    741746
     
    759764       
    760765        if( set_getbool( &ic->irc->set, "debug" ) )
    761                 serv_got_crap( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
     766                imc_log( ic, "Creating new conversation: (id=0x%x,handle=%s)", (int) c, handle );
    762767       
    763768        return c;
     
    773778       
    774779        if( set_getbool( &b->ic->irc->set, "debug" ) )
    775                 serv_got_crap( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
     780                imc_log( b->ic, "User %s added to conversation 0x%x", handle, (int) b );
    776781       
    777782        /* It might be yourself! */
     
    807812       
    808813        if( set_getbool( &b->ic->irc->set, "debug" ) )
    809                 serv_got_crap( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
     814                imc_log( b->ic, "User %s removed from conversation 0x%x (%s)", handle, (int) b, reason ? reason : "" );
    810815       
    811816        /* It might be yourself! */
     
    10051010                        ic->acc->prpl->set_away( ic, s, away );
    10061011                        if( set_getbool( &ic->irc->set, "debug" ) )
    1007                                 serv_got_crap( ic, "Setting away state to %s", s );
     1012                                imc_log( ic, "Setting away state to %s", s );
    10081013                }
    10091014                else
  • protocols/nogaim.h

    r0da65d5 raef4828  
    206206
    207207/* multi.c */
    208 G_MODULE_EXPORT struct im_connection *new_gaim_conn( account_t *acc );
    209 G_MODULE_EXPORT void destroy_gaim_conn( struct im_connection *ic );
    210 G_MODULE_EXPORT void set_login_progress( struct im_connection *ic, int step, char *msg );
    211 G_MODULE_EXPORT void hide_login_progress( struct im_connection *ic, char *msg );
    212 G_MODULE_EXPORT void hide_login_progress_error( struct im_connection *ic, char *msg );
    213 G_MODULE_EXPORT void serv_got_crap( struct im_connection *ic, char *format, ... ) G_GNUC_PRINTF( 2, 3 );
    214 G_MODULE_EXPORT void account_online( struct im_connection *ic );
    215 G_MODULE_EXPORT void signoff( struct im_connection *ic );
     208G_MODULE_EXPORT struct im_connection *imc_new( account_t *acc );
     209G_MODULE_EXPORT void imc_free( struct im_connection *ic );
     210G_MODULE_EXPORT void imc_log( struct im_connection *ic, char *format, ... );
     211G_MODULE_EXPORT void imc_error( struct im_connection *ic, char *format, ... );
     212G_MODULE_EXPORT void imc_connected( struct im_connection *ic );
     213G_MODULE_EXPORT void imc_logout( struct im_connection *ic );
    216214
    217215/* dialogs.c */
    218 G_MODULE_EXPORT void do_error_dialog( struct im_connection *ic, char *msg, char *title );
    219216G_MODULE_EXPORT void do_ask_dialog( struct im_connection *ic, char *msg, void *data, void *doit, void *dont );
    220217
  • protocols/oscar/chat.c

    r0da65d5 raef4828  
    5454                        continue;
    5555                if (!cur->priv) {
    56                         do_error_dialog(sess->aux_data, "chat connection with no name!", "Gaim");
     56                        imc_error(sess->aux_data, "chat connection with no name!");
    5757                        continue;
    5858                }
     
    397397
    398398        if (detaillevel != 0x02) {
    399                 do_error_dialog(sess->aux_data, "Only detaillevel 0x2 is support at the moment", "Gaim");
     399                imc_error(sess->aux_data, "Only detaillevel 0x2 is support at the moment");
    400400                return 1;
    401401        }
     
    615615
    616616        if (channel != 0x0003) {
    617                 do_error_dialog(sess->aux_data, "unknown channel!", "Gaim");
     617                imc_error(sess->aux_data, "unknown channel!");
    618618                return 0;
    619619        }
  • protocols/oscar/chatnav.c

    r0da65d5 raef4828  
    286286
    287287        if (!(bigblock = aim_gettlv(tlvlist, 0x0004, 1))) {
    288                 do_error_dialog(sess->aux_data, "no bigblock in top tlv in create room response", "Gaim");
     288                imc_error(sess->aux_data, "no bigblock in top tlv in create room response");
    289289       
    290290                aim_freetlvchain(&tlvlist);
     
    301301
    302302        if (detaillevel != 0x02) {
    303                 do_error_dialog(sess->aux_data, "unknown detaillevel in create room response", "Gaim");
     303                imc_error(sess->aux_data, "unknown detaillevel in create room response");
    304304                aim_freetlvchain(&tlvlist);
    305305                g_free(ck);
     
    367367
    368368        if (!(snac2 = aim_remsnac(sess, snac->id))) {
    369                 do_error_dialog(sess->aux_data, "received response to unknown request!", "Gaim");
     369                imc_error(sess->aux_data, "received response to unknown request!");
    370370                return 0;
    371371        }
    372372
    373373        if (snac2->family != 0x000d) {
    374                 do_error_dialog(sess->aux_data, "recieved response that maps to corrupt request!", "Gaim");
     374                imc_error(sess->aux_data, "recieved response that maps to corrupt request!");
    375375                return 0;
    376376        }
     
    389389                ret = parseinfo_create(sess, mod, rx, snac, bs, snac2);
    390390        else
    391                 do_error_dialog(sess->aux_data, "unknown request subtype", "Gaim");
     391                imc_error(sess->aux_data, "unknown request subtype");
    392392
    393393        if (snac2)
  • protocols/oscar/icq.c

    r0da65d5 raef4828  
    240240        if (!(tl = aim_readtlvchain(bs)) || !(datatlv = aim_gettlv(tl, 0x0001, 1))) {
    241241                aim_freetlvchain(&tl);
    242                 do_error_dialog(sess->aux_data, "corrupt ICQ response\n", "Gaim");
     242                imc_error(sess->aux_data, "corrupt ICQ response\n");
    243243                return 0;
    244244        }
  • protocols/oscar/im.c

    r0da65d5 raef4828  
    937937
    938938        if (channel != 0x01) {
    939                 do_error_dialog(sess->aux_data, "icbm: ICBM recieved on unsupported channel.  Ignoring.", "Gaim");
     939                imc_error(sess->aux_data, "icbm: ICBM recieved on unsupported channel.  Ignoring.");
    940940                return 0;
    941941        }
     
    13451345
    13461346                } else {
    1347                         // do_error_dialog(sess->aux_data, "Unknown TLV encountered", "Gaim");
     1347                        // imc_error(sess->aux_data, "Unknown TLV encountered");
    13481348                }
    13491349
     
    15171517        cookie2 = aimbs_getraw(&bbs, 8);
    15181518        if (memcmp(cookie, cookie2, 8) != 0)
    1519                 do_error_dialog(sess->aux_data, "rend: warning cookies don't match!", "Gaim");
     1519                imc_error(sess->aux_data, "rend: warning cookies don't match!");
    15201520        memcpy(args.cookie, cookie2, 8);
    15211521        g_free(cookie2);
     
    17831783        } else {
    17841784
    1785                 do_error_dialog(sess->aux_data, "ICBM received on an unsupported channel.  Ignoring.", "Gaim");
     1785                imc_error(sess->aux_data, "ICBM received on an unsupported channel.  Ignoring.");
    17861786
    17871787                return 0;
  • protocols/oscar/info.c

    r0da65d5 raef4828  
    474474                         */
    475475#ifdef DEBUG
    476                         // do_error_dialog(sess->aux_data, G_STRLOC, "Unknown TLV encountered");
     476                        // imc_error(sess->aux_data, G_STRLOC);
    477477#endif
    478478
     
    635635
    636636        if (!origsnac || !origsnac->data) {
    637                 do_error_dialog(sess->aux_data, "major problem: no snac stored!", "Gaim");
     637                imc_error(sess->aux_data, "major problem: no snac stored!");
    638638                return 0;
    639639        }
     
    644644                        (inforeq->infotype != AIM_GETINFO_AWAYMESSAGE) &&
    645645                        (inforeq->infotype != AIM_GETINFO_CAPABILITIES)) {
    646                 do_error_dialog(sess->aux_data, "unknown infotype in request!", "Gaim");
     646                imc_error(sess->aux_data, "unknown infotype in request!");
    647647                return 0;
    648648        }
  • protocols/oscar/oscar.c

    r0da65d5 raef4828  
    263263                        aim_rxdispatch(odata->sess);
    264264                               if (odata->killme)
    265                                        signoff(ic);
     265                                       imc_logout(ic);
    266266                } else {
    267267                        if ((conn->type == AIM_CONN_TYPE_BOS) ||
    268268                                   !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
    269                                 hide_login_progress_error(ic, _("Disconnected."));
    270                                 signoff(ic);
     269                                imc_error(ic, _("Disconnected."));
     270                                imc_logout(ic);
    271271                        } else if (conn->type == AIM_CONN_TYPE_CHAT) {
    272272                                struct chat_connection *c = find_oscar_chat_by_conn(ic, conn);
    273                                 char buf[BUF_LONG];
    274273                                c->conn = NULL;
    275274                                if (c->inpa > 0)
     
    278277                                c->fd = -1;
    279278                                aim_conn_kill(odata->sess, &conn);
    280                                 sprintf(buf, _("You have been disconnected from chat room %s."), c->name);
    281                                 do_error_dialog(sess->aux_data, buf, _("Chat Error!"));
     279                                imc_error(sess->aux_data, _("You have been disconnected from chat room %s."), c->name);
    282280                        } else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
    283281                                if (odata->cnpa > 0)
     
    290288                                                g_slist_remove(odata->create_rooms, cr);
    291289                                        g_free(cr);
    292                                         do_error_dialog(sess->aux_data, _("Chat is currently unavailable"),
    293                                                         _("Gaim - Chat"));
     290                                        imc_error(sess->aux_data, _("Chat is currently unavailable"));
    294291                                }
    295292                                aim_conn_kill(odata->sess, &conn);
     
    328325
    329326        if (source < 0) {
    330                 hide_login_progress(ic, _("Couldn't connect to host"));
    331                 signoff(ic);
     327                imc_error(ic, _("Couldn't connect to host"));
     328                imc_logout(ic);
    332329                return FALSE;
    333330        }
     
    356353        aim_session_t *sess;
    357354        aim_conn_t *conn;
    358         char buf[256];
    359         struct im_connection *ic = new_gaim_conn(acc);
     355        struct im_connection *ic = imc_new(acc);
    360356        struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1);
    361357
     
    382378        conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
    383379        if (conn == NULL) {
    384                 hide_login_progress(ic, _("Unable to login to AIM"));
    385                 signoff(ic);
     380                imc_error(ic, _("Unable to login to AIM"));
     381                imc_logout(ic);
    386382                return;
    387383        }
    388384       
    389385        if (acc->server == NULL) {
    390                 hide_login_progress(ic, "No servername specified");
    391                 signoff(ic);
     386                imc_error(ic, "No servername specified");
     387                imc_logout(ic);
    392388                return;
    393389        }
     
    395391        if (g_strcasecmp(acc->server, "login.icq.com") != 0 &&
    396392            g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) {
    397                 serv_got_crap(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
    398         }
    399        
    400         g_snprintf(buf, sizeof(buf), _("Signon: %s"), ic->username);
    401         set_login_progress(ic, 2, buf);
     393                imc_log(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
     394        }
     395       
     396        imc_log(ic, _("Signon: %s"), ic->username);
    402397
    403398        aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
     
    407402        conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic);
    408403        if (conn->fd < 0) {
    409                 hide_login_progress(ic, _("Couldn't connect to host"));
    410                 signoff(ic);
     404                imc_error(ic, _("Couldn't connect to host"));
     405                imc_logout(ic);
    411406                return;
    412407        }
     
    467462
    468463        if (source < 0) {
    469                 hide_login_progress(ic, _("Could Not Connect"));
    470                 signoff(ic);
     464                imc_error(ic, _("Could Not Connect"));
     465                imc_logout(ic);
    471466                return FALSE;
    472467        }
     
    475470        ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
    476471                        oscar_callback, bosconn);
    477         set_login_progress(ic, 4, _("Connection established, cookie sent"));
     472        imc_log(ic, _("Connection established, cookie sent"));
    478473       
    479474        return FALSE;
     
    498493                case 0x05:
    499494                        /* Incorrect nick/password */
    500                         hide_login_progress(ic, _("Incorrect nickname or password."));
     495                        imc_error(ic, _("Incorrect nickname or password."));
    501496//                      plugin_event(event_error, (void *)980, 0, 0, 0);
    502497                        break;
    503498                case 0x11:
    504499                        /* Suspended account */
    505                         hide_login_progress(ic, _("Your account is currently suspended."));
     500                        imc_error(ic, _("Your account is currently suspended."));
    506501                        break;
    507502                case 0x18:
    508503                        /* connecting too frequently */
    509                         hide_login_progress(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
     504                        imc_error(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
    510505                        break;
    511506                case 0x1c:
    512507                        /* client too old */
    513                         hide_login_progress(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));
     508                        imc_error(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));
    514509                        break;
    515510                default:
    516                         hide_login_progress(ic, _("Authentication Failed"));
     511                        imc_error(ic, _("Authentication Failed"));
    517512                        break;
    518513                }
     
    526521        bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, NULL);
    527522        if (bosconn == NULL) {
    528                 hide_login_progress(ic, _("Internal Error"));
     523                imc_error(ic, _("Internal Error"));
    529524                od->killme = TRUE;
    530525                return 0;
     
    572567        g_free(host);
    573568        if (bosconn->fd < 0) {
    574                 hide_login_progress(ic, _("Could Not Connect"));
     569                imc_error(ic, _("Could Not Connect"));
    575570                od->killme = TRUE;
    576571                return 0;
     
    610605        }
    611606        if (in != '\n') {
    612                 do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
    613                                 " You may be disconnected shortly.", "Login Error");
     607                imc_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
     608                                " You may be disconnected shortly.");
    614609                b_event_remove(pos->inpa);
    615610                closesocket(pos->fd);
     
    633628
    634629        if (source < 0) {
    635                 do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
    636                                 " You may be disconnected shortly.", "Login Error");
     630                imc_error(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
     631                                " You may be disconnected shortly.");
    637632                if (pos->modname)
    638633                        g_free(pos->modname);
     
    711706                        g_free(pos->modname);
    712707                g_free(pos);
    713                 do_error_dialog(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM."
    714                                 " You may be disconnected shortly.", "Login Error");
     708                imc_error(sess->aux_data, "Gaim was unable to get a valid hash for logging into AIM."
     709                                " You may be disconnected shortly.");
    715710        }
    716711        pos->fd = fd;
     
    12101205
    12111206                case 0x0007: { /* Someone has denied you authorization */
    1212                         serv_got_crap(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
     1207                        imc_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
    12131208                } break;
    12141209
    12151210                case 0x0008: { /* Someone has granted you authorization */
    1216                         serv_got_crap(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
     1211                        imc_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", args->uin, args->msg ? args->msg : _("No reason given.") );
    12171212                } break;
    12181213
     
    13391334                        break;
    13401335        }
    1341         do_error_dialog(sess->aux_data, buf, _("Gaim - Error"));
     1336        imc_error(sess->aux_data, buf);
    13421337
    13431338        return 1;
     
    13471342        va_list ap;
    13481343        guint16 reason;
    1349         char *m;
    13501344
    13511345        va_start(ap, fr);
     
    13531347        va_end(ap);
    13541348
    1355         m = g_strdup_printf(_("SNAC threw error: %s\n"),
    1356                         reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error");
    1357         do_error_dialog(sess->aux_data, m, _("Gaim - Oscar SNAC Error"));
    1358         g_free(m);
     1349        imc_error(sess->aux_data, _("SNAC threw error: %s"),
     1350                  reason < msgerrreasonlen ? msgerrreason[reason] : "Unknown error");
    13591351
    13601352        return 1;
     
    13651357        char *destn;
    13661358        guint16 reason;
    1367         char buf[1024];
    13681359
    13691360        va_start(ap, fr);
     
    13721363        va_end(ap);
    13731364
    1374         sprintf(buf, _("Your message to %s did not get sent: %s"), destn,
     1365        imc_error(sess->aux_data, _("Your message to %s did not get sent: %s"), destn,
    13751366                        (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
    1376         do_error_dialog(sess->aux_data, buf, _("Gaim - Error"));
    13771367
    13781368        return 1;
     
    13831373        char *destn;
    13841374        guint16 reason;
    1385         char buf[1024];
    13861375
    13871376        va_start(ap, fr);
     
    13901379        va_end(ap);
    13911380
    1392         sprintf(buf, _("User information for %s unavailable: %s"), destn,
     1381        imc_error(sess->aux_data, _("User information for %s unavailable: %s"), destn,
    13931382                        (reason < msgerrreasonlen) ? msgerrreason[reason] : _("Reason unknown"));
    1394         do_error_dialog(sess->aux_data, buf, _("Gaim - Error"));
    1395 
    13961383
    13971384        return 1;
     
    14091396
    14101397        if (id < 4)
    1411                 do_error_dialog(sess->aux_data, _("Your connection may be lost."),
    1412                                 _("AOL error"));
     1398                imc_error(sess->aux_data, _("Your connection may be lost."));
    14131399
    14141400        return 1;
     
    16041590                aim_conn_setlatency(fr->conn, windowsize/4);
    16051591        } else if (code == AIM_RATE_CODE_LIMIT) {
    1606                 do_error_dialog(sess->aux_data, _("The last message was not sent because you are over the rate limit. "
    1607                                   "Please wait 10 seconds and try again."), _("Gaim - Error"));
     1592                imc_error(sess->aux_data, _("The last message was not sent because you are over the rate limit. "
     1593                          "Please wait 10 seconds and try again."));
    16081594                aim_conn_setlatency(fr->conn, windowsize/2);
    16091595        } else if (code == AIM_RATE_CODE_CLEARLIMIT) {
     
    18091795
    18101796                case 0x0007: { /* Someone has denied you authorization */
    1811                         serv_got_crap(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
     1797                        imc_log(sess->aux_data, "The user %u has denied your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
    18121798                } break;
    18131799
    18141800                case 0x0008: { /* Someone has granted you authorization */
    1815                         serv_got_crap(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
     1801                        imc_log(sess->aux_data, "The user %u has granted your request to add them to your contact list for the following reason:\n%s", msg->sender, msg->msg ? msg->msg : _("No reason given.") );
    18161802                } break;
    18171803
     
    19261912
    19271913        if (od->rights.maxawaymsglen == 0)
    1928                 do_error_dialog(ic, "oscar_set_away_aim called before locate rights received", "Protocol Error");
     1914                imc_error(ic, "oscar_set_away_aim called before locate rights received");
    19291915
    19301916        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
     
    19441930                errstr = g_strdup_printf("Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
    19451931
    1946                 do_error_dialog(ic, errstr, "Away Message Too Long");
     1932                imc_error(ic, errstr);
    19471933
    19481934                g_free(errstr);
     
    21102096       
    21112097        /* Now that we have a buddy list, we can tell BitlBee that we're online. */
    2112         account_online(ic);
     2098        imc_connected(ic);
    21132099       
    21142100        return 1;
     
    21322118                {
    21332119                        /* Hmm, the length should be even... */
    2134                         do_error_dialog( sess->aux_data, "Received SSI ACK package with non-even length", "Gaim - Error" );
     2120                        imc_error( sess->aux_data, "Received SSI ACK package with non-even length");
    21352121                        return( 0 );
    21362122                }
     
    21432129                        if( st == 0x0E )
    21442130                        {
    2145                                 serv_got_crap( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );
     2131                                imc_log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );
    21462132                               
    21472133                                aim_ssi_auth_request( sess, fr->conn, list, "" );
     
    23302316        }
    23312317
    2332                 serv_got_crap(ic, "%s\n%s", _("User Info"), str->str);
     2318                imc_log(ic, "%s\n%s", _("User Info"), str->str);
    23332319        g_string_free(str, TRUE);
    23342320
     
    24242410                        idletime.tm_sec = 0;
    24252411                        strftime(buff, 256, _("%d days %H hours %M minutes"), &idletime);
    2426                         serv_got_crap(ic, "%s: %s", _("Idle Time"), buff);
     2412                        imc_log(ic, "%s: %s", _("Idle Time"), buff);
    24272413                }
    24282414               
    24292415                if(text) {
    24302416                        utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
    2431                         serv_got_crap(ic, "%s\n%s", _("User Info"), utf8);
     2417                        imc_log(ic, "%s\n%s", _("User Info"), utf8);
    24322418                } else {
    2433                         serv_got_crap(ic, _("No user info available."));
     2419                        imc_log(ic, _("No user info available."));
    24342420                }
    24352421        } else if(infotype == AIM_GETINFO_AWAYMESSAGE && userinfo->flags & AIM_FLAG_AWAY) {
    24362422                utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
    2437                 serv_got_crap(ic, "%s\n%s", _("Away Message"), utf8);
     2423                imc_log(ic, "%s\n%s", _("Away Message"), utf8);
    24382424        }
    24392425
  • protocols/oscar/rxqueue.c

    r0da65d5 raef4828  
    392392                aim_bstream_rewind(&flaphdr);
    393393                start = aimbs_get8(&flaphdr);
    394                 do_error_dialog(sess->aux_data, "FLAP framing disrupted", "Gaim");
     394                imc_error(sess->aux_data, "FLAP framing disrupted");
    395395                aim_conn_close(conn);
    396396                return -1;
  • protocols/oscar/search.c

    r0da65d5 raef4828  
    3939        /* XXX the modules interface should have already retrieved this for us */
    4040        if (!(snac2 = aim_remsnac(sess, snac->id))) {
    41                 do_error_dialog(sess->aux_data, "couldn't get snac", "Gaim");
     41                imc_error(sess->aux_data, "couldn't get snac");
    4242                return 0;
    4343        }
  • protocols/oscar/service.c

    r0da65d5 raef4828  
    567567                group = aimbs_get16(bs);
    568568
    569                 do_error_dialog(sess->aux_data, "bifurcated migration unsupported", "Gaim");
     569                imc_error(sess->aux_data, "bifurcated migration unsupported");
    570570        }
    571571
     
    894894*/
    895895                } else
    896                         do_error_dialog(sess->aux_data, "WARNING: unknown hash request", "Gaim");
     896                        imc_error(sess->aux_data, "WARNING: unknown hash request");
    897897
    898898        }
  • protocols/oscar/txqueue.c

    r0da65d5 raef4828  
    3030
    3131        if (!conn) {
    32                 do_error_dialog(sess->aux_data, "no connection specified", "Gaim");
     32                imc_error(sess->aux_data, "no connection specified");
    3333                return NULL;
    3434        }
     
    4646
    4747        } else
    48                 do_error_dialog(sess->aux_data, "unknown framing", "Gaim");
     48                imc_error(sess->aux_data, "unknown framing");
    4949
    5050        if (datalen > 0) {
     
    8080
    8181        if (!fr->conn) {
    82                 do_error_dialog(sess->aux_data, "WARNING: enqueueing packet with no connection", "Gaim");
     82                imc_error(sess->aux_data, "WARNING: enqueueing packet with no connection");
    8383                fr->conn = aim_getconn_type(sess, AIM_CONN_TYPE_BOS);
    8484        }
     
    120120
    121121        if (!fr->conn) {
    122                 do_error_dialog(sess->aux_data, "packet has no connection", "Gaim");
     122                imc_error(sess->aux_data, "packet has no connection");
    123123                aim_frame_destroy(fr);
    124124                return 0;
  • protocols/yahoo/yahoo.c

    r0da65d5 raef4828  
    123123static void byahoo_login( account_t *acc )
    124124{
    125         struct im_connection *ic = new_gaim_conn( acc );
     125        struct im_connection *ic = imc_new( acc );
    126126        struct byahoo_data *yd = ic->proto_data = g_new0( struct byahoo_data, 1 );
    127127       
     
    129129        yd->current_status = YAHOO_STATUS_AVAILABLE;
    130130       
    131         set_login_progress( ic, 1, "Connecting" );
     131        imc_log( ic, "Connecting" );
    132132        yd->y2_id = yahoo_init( acc->user, acc->pass );
    133133        yahoo_login( yd->y2_id, yd->current_status );
     
    163163{
    164164        /* Just make an URL and let the user fetch the info */
    165         serv_got_crap(ic, "%s\n%s: %s%s", _("User Info"),
     165        imc_log(ic, "%s\n%s: %s%s", _("User Info"),
    166166                        _("For now, fetch yourself"), yahoo_get_profile_url(),
    167167                        who);
     
    511511        if( succ == YAHOO_LOGIN_OK )
    512512        {
    513                 account_online( ic );
     513                imc_connected( ic );
    514514               
    515515                yd->logged_in = TRUE;
     
    550550               
    551551                if( yd->logged_in )
    552                         hide_login_progress_error( ic, s );
     552                        imc_error( ic, s );
    553553                else
    554                         hide_login_progress( ic, s );
     554                        imc_error( ic, s );
    555555               
    556556                g_free( s );
    557557               
    558                 signoff( ic );
     558                imc_logout( ic );
    559559        }
    560560}
     
    619619        struct im_connection *ic = byahoo_get_ic_by_id( id );
    620620       
    621         serv_got_crap( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who );
     621        imc_log( ic, "Got a file transfer (file = %s) from %s. Ignoring for now due to lack of support.", fname, who );
    622622}
    623623
     
    639639        struct im_connection *ic = byahoo_get_ic_by_id( id );
    640640       
    641         serv_got_crap( ic, "Yahoo! system message: %s", msg );
     641        imc_log( ic, "Yahoo! system message: %s", msg );
    642642}
    643643
     
    646646        struct im_connection *ic = byahoo_get_ic_by_id( id );
    647647       
    648         serv_got_crap( ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from );
     648        imc_log( ic, "Got a webcam invitation from %s. IRC+webcams is a no-no though...", from );
    649649}
    650650
     
    653653        struct im_connection *ic = byahoo_get_ic_by_id( id );
    654654       
     655        imc_error( ic, "%s", err );
     656       
    655657        if( fatal )
    656         {
    657                 hide_login_progress_error( ic, err );
    658                 signoff( ic );
    659         }
    660         else
    661         {
    662                 do_error_dialog( ic, err, "Yahoo! error" );
    663         }
     658                imc_logout( ic );
    664659}
    665660
     
    829824        struct im_connection *ic = byahoo_get_ic_by_id( id );
    830825       
    831         serv_got_crap( ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg );
     826        imc_log( ic, "Invite to chatroom %s rejected by %s: %s", room, who, msg );
    832827}
    833828
     
    912907       
    913908        if( from && subj )
    914                 serv_got_crap( ic, "Received e-mail message from %s with subject `%s'", from, subj );
     909                imc_log( ic, "Received e-mail message from %s with subject `%s'", from, subj );
    915910        else if( cnt > 0 )
    916                 serv_got_crap( ic, "Received %d new e-mails", cnt );
     911                imc_log( ic, "Received %d new e-mails", cnt );
    917912}
    918913
  • query.c

    r0da65d5 raef4828  
    122122       
    123123        if( count > 0 )
    124                 serv_got_crap( ic, "Flushed %d unanswered question(s) for this connection.", count );
     124                imc_log( ic, "Flushed %d unanswered question(s) for this connection.", count );
    125125       
    126126        q = query_default( irc );
     
    140140        if( ans )
    141141        {
    142                 serv_got_crap( q->ic, "Accepted: %s", q->question );
     142                imc_log( q->ic, "Accepted: %s", q->question );
    143143                q->yes( NULL, q->data );
    144144        }
    145145        else
    146146        {
    147                 serv_got_crap( q->ic, "Rejected: %s", q->question );
     147                imc_log( q->ic, "Rejected: %s", q->question );
    148148                q->no( NULL, q->data );
    149149        }
     
    160160        if( q->ic )
    161161        {
    162                 serv_got_crap( q->ic, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
     162                imc_log( q->ic, "New request: %s\nYou can use the \2yes\2/\2no\2 commands to accept/reject this request.", q->question );
    163163        }
    164164        else
Note: See TracChangeset for help on using the changeset viewer.