Changeset 84b045d for protocols/msn


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.

Location:
protocols/msn
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protocols/msn/msn.c

    rc2fb3809 r84b045d  
    3939static void msn_login( account_t *acc )
    4040{
    41         struct im_connection *ic = imc_new( acc );
     41        struct im_connection *ic = imcb_new( acc );
    4242        struct msn_data *md = g_new0( struct msn_data, 1 );
    4343       
     
    4747        if( strchr( acc->user, '@' ) == NULL )
    4848        {
    49                 imc_error( ic, "Invalid account name" );
     49                imcb_error( ic, "Invalid account name" );
    5050                imc_logout( ic, FALSE );
    5151                return;
    5252        }
    5353       
    54         imc_log( ic, "Connecting" );
     54        imcb_log( ic, "Connecting" );
    5555       
    5656        md->fd = proxy_connect( "messenger.hotmail.com", 1863, msn_ns_connected, ic );
    5757        if( md->fd < 0 )
    5858        {
    59                 imc_error( ic, "Could not connect to server" );
     59                imcb_error( ic, "Could not connect to server" );
    6060                imc_logout( ic, TRUE );
    6161                return;
     
    9696                                m = l->data;
    9797                       
    98                                 imc_log( ic, "Warning: Closing down MSN connection with unsent message to %s, you'll have to resend it.", m->who );
     98                                imcb_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         imc_log( ic, "%s\n%s: %s%s", _("User Info"), _("For now, fetch yourself"), PROFILE_URL, who );
     230        imcb_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                 imc_log( ic, "Maximum name length exceeded" );
     375                imcb_log( ic, "Maximum name length exceeded" );
    376376                return NULL;
    377377        }
  • protocols/msn/msn_util.c

    rc2fb3809 r84b045d  
    3636        if( st != len )
    3737        {
    38                 imc_error( ic, "Short write() to main server" );
     38                imcb_error( ic, "Short write() to main server" );
    3939                imc_logout( ic, TRUE );
    4040                return( 0 );
     
    4646int msn_logged_in( struct im_connection *ic )
    4747{
    48         imc_connected( ic );
     48        imcb_connected( ic );
    4949       
    5050        return( 0 );
     
    9595       
    9696        if( find_buddy( bla->ic, bla->handle ) == NULL )
    97                 show_got_added( bla->ic, bla->handle, NULL );
     97                imcb_ask_add( bla->ic, bla->handle, NULL );
    9898       
    9999        g_free( bla->handle );
     
    123123                    "The user %s (%s) wants to add you to his/her buddy list.",
    124124                    handle, realname );
    125         do_ask_dialog( ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
     125        imcb_ask( ic, buf, bla, msn_buddy_ask_yes, msn_buddy_ask_no );
    126126}
    127127
  • 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 );
  • protocols/msn/sb.c

    rc2fb3809 r84b045d  
    222222                g_slist_free( sb->msgq );
    223223               
    224                 imc_log( ic, "Warning: Closing down MSN switchboard connection with "
     224                imcb_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                 imc_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
     323                imcb_error( ic, "Received an XFR from a switchboard server, unable to comply! This is likely to be a bug, please report it!" );
    324324                imc_logout( ic, TRUE );
    325325                return( 0 );
     
    528528                const struct msn_status_code *err = msn_status_by_number( num );
    529529               
    530                 imc_error( ic, "Error reported by switchboard server: %s", err->text );
     530                imcb_error( ic, "Error reported by switchboard server: %s", err->text );
    531531               
    532532                if( err->flags & STATUS_SB_FATAL )
Note: See TracChangeset for help on using the changeset viewer.