Changeset 84b045d for protocols/msn/ns.c


Ignore:
Timestamp:
2007-04-16T01:03:08Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
6bbb939
Parents:
c2fb3809
Message:

s/imc/imcb/ for callback functions. Moved things aroundin nogaim.h a
little bit, grouping things by category instead of original Gaim 0.58
filename.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/ns.c

    rc2fb3809 r84b045d  
    4747        if( source == -1 )
    4848        {
    49                 imc_error( ic, "Could not connect to server" );
     49                imcb_error( ic, "Could not connect to server" );
    5050                imc_logout( ic, TRUE );
    5151                return FALSE;
     
    7676        {
    7777                ic->inpa = b_input_add( md->fd, GAIM_INPUT_READ, msn_ns_callback, ic );
    78                 imc_log( ic, "Connected to server, waiting for reply" );
     78                imcb_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                 imc_error( ic, "Error while reading from server" );
     91                imcb_error( ic, "Error while reading from server" );
    9292                imc_logout( ic, TRUE );
    9393               
     
    114114                if( cmd[2] && strncmp( cmd[2], "MSNP8", 5 ) != 0 )
    115115                {
    116                         imc_error( ic, "Unsupported protocol" );
     116                        imcb_error( ic, "Unsupported protocol" );
    117117                        imc_logout( ic, FALSE );
    118118                        return( 0 );
     
    143143                        if( !server )
    144144                        {
    145                                 imc_error( ic, "Syntax error" );
     145                                imcb_error( ic, "Syntax error" );
    146146                                imc_logout( ic, TRUE );
    147147                                return( 0 );
     
    151151                        server = cmd[3];
    152152                       
    153                         imc_log( ic, "Transferring to other server" );
     153                        imcb_log( ic, "Transferring to other server" );
    154154                       
    155155                        md->fd = proxy_connect( server, port, msn_ns_connected, ic );
     
    162162                        if( !server )
    163163                        {
    164                                 imc_error( ic, "Syntax error" );
     164                                imcb_error( ic, "Syntax error" );
    165165                                imc_logout( ic, TRUE );
    166166                                return( 0 );
     
    172172                        if( strcmp( cmd[4], "CKI" ) != 0 )
    173173                        {
    174                                 imc_error( ic, "Unknown authentication method for switchboard" );
     174                                imcb_error( ic, "Unknown authentication method for switchboard" );
    175175                                imc_logout( ic, TRUE );
    176176                                return( 0 );
     
    204204                else
    205205                {
    206                         imc_error( ic, "Syntax error" );
     206                        imcb_error( ic, "Syntax error" );
    207207                        imc_logout( ic, TRUE );
    208208                        return( 0 );
     
    216216                        if( !passport_get_id( msn_auth_got_passport_id, ic, ic->acc->user, ic->acc->pass, cmd[4] ) )
    217217                        {
    218                                 imc_error( ic, "Error while contacting Passport server" );
     218                                imcb_error( ic, "Error while contacting Passport server" );
    219219                                imc_logout( ic, TRUE );
    220220                                return( 0 );
     
    236236                        }
    237237                       
    238                         imc_log( ic, "Authenticated, getting buddy list" );
     238                        imcb_log( ic, "Authenticated, getting buddy list" );
    239239                       
    240240                        g_snprintf( buf, sizeof( buf ), "SYN %d 0\r\n", ++md->trId );
     
    243243                else
    244244                {
    245                         imc_error( ic, "Unknown authentication type" );
     245                        imcb_error( ic, "Unknown authentication type" );
    246246                        imc_logout( ic, FALSE );
    247247                        return( 0 );
     
    252252                if( num_parts != 4 )
    253253                {
    254                         imc_error( ic, "Syntax error" );
     254                        imcb_error( ic, "Syntax error" );
    255255                        imc_logout( ic, TRUE );
    256256                        return( 0 );
     
    261261                if( md->handler->msglen <= 0 )
    262262                {
    263                         imc_error( ic, "Syntax error" );
     263                        imcb_error( ic, "Syntax error" );
    264264                        imc_logout( ic, TRUE );
    265265                        return( 0 );
     
    292292                if( num_parts != 4 && num_parts != 5 )
    293293                {
    294                         imc_error( ic, "Syntax error" );
     294                        imcb_error( ic, "Syntax error" );
    295295                        imc_logout( ic, TRUE );
    296296                        return( 0 );
     
    328328                        if( ic->flags & OPT_LOGGED_IN )
    329329                        {
    330                                 imc_log( ic, "Successfully transferred to different server" );
     330                                imcb_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                         imc_error( ic, "Syntax error" );
     346                        imcb_error( ic, "Syntax error" );
    347347                        imc_logout( ic, TRUE );
    348348                        return( 0 );
     
    363363                if( num_parts != 3 )
    364364                {
    365                         imc_error( ic, "Syntax error" );
     365                        imcb_error( ic, "Syntax error" );
    366366                        imc_logout( ic, TRUE );
    367367                        return( 0 );
     
    385385                if( num_parts != 6 )
    386386                {
    387                         imc_error( ic, "Syntax error" );
     387                        imcb_error( ic, "Syntax error" );
    388388                        imc_logout( ic, TRUE );
    389389                        return( 0 );
     
    413413                if( num_parts != 5 )
    414414                {
    415                         imc_error( ic, "Syntax error" );
     415                        imcb_error( ic, "Syntax error" );
    416416                        imc_logout( ic, TRUE );
    417417                        return( 0 );
     
    438438                if( num_parts != 7 )
    439439                {
    440                         imc_error( ic, "Syntax error" );
     440                        imcb_error( ic, "Syntax error" );
    441441                        imc_logout( ic, TRUE );
    442442                        return( 0 );
     
    448448                if( !server )
    449449                {
    450                         imc_error( ic, "Syntax error" );
     450                        imcb_error( ic, "Syntax error" );
    451451                        imc_logout( ic, TRUE );
    452452                        return( 0 );
     
    458458                if( strcmp( cmd[3], "CKI" ) != 0 )
    459459                {
    460                         imc_error( ic, "Unknown authentication method for switchboard" );
     460                        imcb_error( ic, "Unknown authentication method for switchboard" );
    461461                        imc_logout( ic, TRUE );
    462462                        return( 0 );
     
    478478                        if( strchr( cmd[4], '@' ) == NULL )
    479479                        {
    480                                 imc_error( ic, "Syntax error" );
     480                                imcb_error( ic, "Syntax error" );
    481481                                imc_logout( ic, TRUE );
    482482                                return( 0 );
     
    501501                if( cmd[1] && strcmp( cmd[1], "OTH" ) == 0 )
    502502                {
    503                         imc_error( ic, "Someone else logged in with your account" );
     503                        imcb_error( ic, "Someone else logged in with your account" );
    504504                        allow_reconnect = FALSE;
    505505                }
    506506                else if( cmd[1] && strcmp( cmd[1], "SSD" ) == 0 )
    507507                {
    508                         imc_error( ic, "Terminating session because of server shutdown" );
     508                        imcb_error( ic, "Terminating session because of server shutdown" );
    509509                }
    510510                else
    511511                {
    512                         imc_error( ic, "Session terminated by remote server (reason unknown)" );
     512                        imcb_error( ic, "Session terminated by remote server (reason unknown)" );
    513513                }
    514514               
     
    520520                if( num_parts != 5 )
    521521                {
    522                         imc_error( ic, "Syntax error" );
     522                        imcb_error( ic, "Syntax error" );
    523523                        imc_logout( ic, TRUE );
    524524                        return( 0 );
     
    548548        else if( strcmp( cmd[0], "IPG" ) == 0 )
    549549        {
    550                 imc_error( ic, "Received IPG command, we don't handle them yet." );
     550                imcb_error( ic, "Received IPG command, we don't handle them yet." );
    551551               
    552552                md->handler->msglen = atoi( cmd[1] );
     
    554554                if( md->handler->msglen <= 0 )
    555555                {
    556                         imc_error( ic, "Syntax error" );
     556                        imcb_error( ic, "Syntax error" );
    557557                        imc_logout( ic, TRUE );
    558558                        return( 0 );
     
    564564                const struct msn_status_code *err = msn_status_by_number( num );
    565565               
    566                 imc_error( ic, "Error reported by MSN server: %s", err->text );
     566                imcb_error( ic, "Error reported by MSN server: %s", err->text );
    567567               
    568568                if( err->flags & STATUS_FATAL )
     
    618618                                {
    619619                                        if( arg1 )
    620                                                 imc_log( ic, "The server is going down for maintenance in %s minutes.", arg1 );
     620                                                imcb_log( ic, "The server is going down for maintenance in %s minutes.", arg1 );
    621621                                }
    622622                               
     
    635635                                if( inbox && folders )
    636636                                {
    637                                         imc_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
     637                                        imcb_log( ic, "INBOX contains %s new messages, plus %s messages in other folders.", inbox, folders );
    638638                                }
    639639                        }
     
    645645                                if( from && fromname )
    646646                                {
    647                                         imc_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
     647                                        imcb_log( ic, "Received an e-mail message from %s <%s>.", fromname, from );
    648648                                }
    649649                        }
     
    673673        if( key == NULL )
    674674        {
    675                 imc_error( ic, "Error during Passport authentication (%s)",
     675                imcb_error( ic, "Error during Passport authentication (%s)",
    676676                               rep->error_string ? rep->error_string : "Unknown error" );
    677677                imc_logout( ic, TRUE );
Note: See TracChangeset for help on using the changeset viewer.