Changeset 84b045d for protocols/jabber


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/jabber
Files:
6 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/io.c

    rc2fb3809 r84b045d  
    117117                jd->fd = -1;
    118118               
    119                 imc_error( ic, "Short write() to server" );
     119                imcb_error( ic, "Short write() to server" );
    120120                imc_logout( ic, TRUE );
    121121                return FALSE;
     
    160160                if( xt_feed( jd->xt, buf, st ) < 0 )
    161161                {
    162                         imc_error( ic, "XML stream error" );
     162                        imcb_error( ic, "XML stream error" );
    163163                        imc_logout( ic, TRUE );
    164164                        return FALSE;
     
    203203                                        if( set_getbool( &ic->acc->set, "tls" ) )
    204204                                        {
    205                                                 imc_error( ic, "TLS is turned on for this "
     205                                                imcb_error( ic, "TLS is turned on for this "
    206206                                                          "account, but is not supported by this server" );
    207207                                                imc_logout( ic, FALSE );
     
    216216                        else
    217217                        {
    218                                 imc_error( ic, "XML stream error" );
     218                                imcb_error( ic, "XML stream error" );
    219219                                imc_logout( ic, TRUE );
    220220                                return FALSE;
     
    227227                jd->fd = -1;
    228228               
    229                 imc_error( ic, "Error while reading from server" );
     229                imcb_error( ic, "Error while reading from server" );
    230230                imc_logout( ic, TRUE );
    231231                return FALSE;
     
    242242        if( source == -1 )
    243243        {
    244                 imc_error( ic, "Could not connect to server" );
     244                imcb_error( ic, "Could not connect to server" );
    245245                imc_logout( ic, TRUE );
    246246                return FALSE;
    247247        }
    248248       
    249         imc_log( ic, "Connected to server, logging in" );
     249        imcb_log( ic, "Connected to server, logging in" );
    250250       
    251251        return jabber_start_stream( ic );
     
    263263                jd->ssl = NULL;
    264264               
    265                 imc_error( ic, "Could not connect to server" );
     265                imcb_error( ic, "Could not connect to server" );
    266266                imc_logout( ic, TRUE );
    267267                return FALSE;
    268268        }
    269269       
    270         imc_log( ic, "Connected to server, logging in" );
     270        imcb_log( ic, "Connected to server, logging in" );
    271271       
    272272        return jabber_start_stream( ic );
     
    297297                if( c && ( !trytls && !set_getbool( &ic->acc->set, "tls" ) ) )
    298298                {
    299                         imc_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
     299                        imcb_error( ic, "Server requires TLS connections, but TLS is turned off for this account" );
    300300                        imc_logout( ic, FALSE );
    301301                       
     
    327327                if( !trytls && set_getbool( &ic->acc->set, "tls" ) )
    328328                {
    329                         imc_error( ic, "TLS is turned on for this account, but is not supported by this server" );
     329                        imcb_error( ic, "TLS is turned on for this account, but is not supported by this server" );
    330330                        imc_logout( ic, FALSE );
    331331                       
     
    417417        jd->w_inpa = jd->r_inpa = 0;
    418418       
    419         imc_log( ic, "Converting stream to TLS" );
     419        imcb_log( ic, "Converting stream to TLS" );
    420420       
    421421        jd->ssl = ssl_starttls( jd->fd, jabber_connected_ssl, ic );
     
    453453        if( type == NULL )
    454454        {
    455                 imc_error( ic, "Unknown stream error reported by server" );
     455                imcb_error( ic, "Unknown stream error reported by server" );
    456456                imc_logout( ic, allow_reconnect );
    457457                return XT_ABORT;
     
    463463        if( strcmp( type, "conflict" ) == 0 )
    464464        {
    465                 imc_error( ic, "Account and resource used from a different location" );
     465                imcb_error( ic, "Account and resource used from a different location" );
    466466                allow_reconnect = FALSE;
    467467        }
    468468        else
    469469        {
    470                 imc_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
     470                imcb_error( ic, "Stream error: %s%s%s", type, text ? ": " : "", text ? text : "" );
    471471        }
    472472       
  • protocols/jabber/iq.c

    rc2fb3809 r84b045d  
    3939        if( !type )
    4040        {
    41                 imc_error( ic, "Received IQ packet without type." );
     41                imcb_error( ic, "Received IQ packet without type." );
    4242                imc_logout( ic, TRUE );
    4343                return XT_ABORT;
     
    6060               
    6161                if( entry == NULL )
    62                         imc_log( ic, "WARNING: Received IQ-%s packet with unknown/expired ID %s!", type, s );
     62                        imcb_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                         imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
     71                        imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
    7272                        return XT_HANDLED;
    7373                }
     
    132132                    !( s = xt_find_attr( c, "xmlns" ) ) )
    133133                {
    134                         imc_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
     134                        imcb_log( ic, "WARNING: Received incomplete IQ-%s packet", type );
    135135                        return XT_HANDLED;
    136136                }
     
    154154                        else
    155155                        {
    156                                 imc_log( ic, "WARNING: %s tried to fake a roster push!", s ? s : "(unknown)" );
     156                                imcb_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                 imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
     221                imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    222222                imc_logout( ic, FALSE );
    223223                return XT_HANDLED;
     
    258258                xt_free_node( reply );
    259259               
    260                 imc_error( ic, "Can't find suitable authentication method" );
     260                imcb_error( ic, "Can't find suitable authentication method" );
    261261                imc_logout( ic, FALSE );
    262262                return XT_ABORT;
     
    277277        if( !( type = xt_find_attr( node, "type" ) ) )
    278278        {
    279                 imc_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
     279                imcb_log( ic, "WARNING: Received incomplete IQ packet while authenticating" );
    280280                imc_logout( ic, FALSE );
    281281                return XT_HANDLED;
     
    284284        if( strcmp( type, "error" ) == 0 )
    285285        {
    286                 imc_error( ic, "Authentication failure" );
     286                imcb_error( ic, "Authentication failure" );
    287287                imc_logout( ic, FALSE );
    288288                return XT_ABORT;
     
    311311                if( c && c->text_len && ( s = strchr( c->text, '/' ) ) &&
    312312                    strcmp( s + 1, set_getstr( &ic->acc->set, "resource" ) ) != 0 )
    313                         imc_log( ic, "Server changed session resource string to `%s'", s + 1 );
     313                        imcb_log( ic, "Server changed session resource string to `%s'", s + 1 );
    314314               
    315315                jd->flags &= ~JFLAG_WAIT_BIND;
     
    334334        int st;
    335335       
    336         imc_log( ic, "Authenticated, requesting buddy list" );
     336        imcb_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                 imc_log( ic, "WARNING: Received NULL roster packet" );
     355                imcb_log( ic, "WARNING: Received NULL roster packet" );
    356356                return XT_HANDLED;
    357357        }
     
    397397       
    398398        if( initial )
    399                 imc_connected( ic );
     399                imcb_connected( ic );
    400400       
    401401        return XT_HANDLED;
     
    428428        {
    429429                s = xt_find_attr( orig, "to" ); /* If this returns NULL something's wrong.. */
    430                 imc_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
     430                imcb_log( ic, "Could not retrieve vCard of %s", s ? s : "(NULL)" );
    431431                return XT_HANDLED;
    432432        }
     
    536536        /* *sigh* */
    537537       
    538         imc_log( ic, "%s", reply->str );
     538        imcb_log( ic, "%s", reply->str );
    539539        g_string_free( reply, TRUE );
    540540       
  • protocols/jabber/jabber.c

    rc2fb3809 r84b045d  
    5959static void jabber_login( account_t *acc )
    6060{
    61         struct im_connection *ic = imc_new( acc );
     61        struct im_connection *ic = imcb_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                 imc_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
     74                imcb_error( ic, "Incomplete account name (format it like <username@jabberserver.name>)" );
    7575                imc_logout( ic, FALSE );
    7676                return;
     
    159159                connect_to = jd->server;
    160160       
    161         imc_log( ic, "Connecting" );
     161        imcb_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                 imc_log( ic, "Incorrect port number, must be in the %d-%d range",
     166                imcb_log( ic, "Incorrect port number, must be in the %d-%d range",
    167167                               JABBER_PORT_MIN, JABBER_PORT_MAX );
    168168                imc_logout( ic, FALSE );
     
    186186        if( jd->fd == -1 )
    187187        {
    188                 imc_error( ic, "Could not connect to server" );
     188                imcb_error( ic, "Could not connect to server" );
    189189                imc_logout( ic, TRUE );
    190190        }
     
    285285        while( bud )
    286286        {
    287                 imc_log( ic, "Buddy %s (%d) information:\nAway state: %s\nAway message: %s",
     287                imcb_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/jabber_util.c

    rc2fb3809 r84b045d  
    224224       
    225225        if( find_buddy( bla->ic, bla->handle ) == NULL )
    226                 show_got_added( bla->ic, bla->handle, NULL );
     226                imcb_ask_add( bla->ic, bla->handle, NULL );
    227227       
    228228        g_free( bla->handle );
     
    247247       
    248248        buf = g_strdup_printf( "The user %s wants to add you to his/her buddy list.", handle );
    249         do_ask_dialog( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
     249        imcb_ask( ic, buf, bla, jabber_buddy_ask_yes, jabber_buddy_ask_no );
    250250        g_free( buf );
    251251}
  • protocols/jabber/presence.c

    rc2fb3809 r84b045d  
    4141                {
    4242                        if( set_getbool( &ic->irc->set, "debug" ) )
    43                                 imc_log( ic, "WARNING: Could not handle presence information from JID: %s", from );
     43                                imcb_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                                 imc_log( ic, "WARNING: Received presence information from unknown JID: %s", from );
     76                                imcb_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                 imc_log( ic, "%s just accepted your authorization request", from );
     105                imcb_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

    rc2fb3809 r84b045d  
    3838                   IQ authentication. Strange things happen when you try
    3939                   to do both... */
    40                 imc_log( ic, "XMPP 1.0 non-compliant server seems to support SASL, please report this as a BitlBee bug!" );
     40                imcb_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                 imc_log( ic, "Stream error while authenticating" );
     47                imcb_log( ic, "Stream error while authenticating" );
    4848                imc_logout( ic, FALSE );
    4949                return XT_ABORT;
     
    6363        if( !sup_plain && !sup_digest )
    6464        {
    65                 imc_error( ic, "No known SASL authentication schemes supported" );
     65                imcb_error( ic, "No known SASL authentication schemes supported" );
    6666                imc_logout( ic, FALSE );
    6767                return XT_ABORT;
     
    280280
    281281error:
    282         imc_error( ic, "Incorrect SASL challenge received" );
     282        imcb_error( ic, "Incorrect SASL challenge received" );
    283283        imc_logout( ic, FALSE );
    284284
     
    304304        if( !s || strcmp( s, XMLNS_SASL ) != 0 )
    305305        {
    306                 imc_log( ic, "Stream error while authenticating" );
     306                imcb_log( ic, "Stream error while authenticating" );
    307307                imc_logout( ic, FALSE );
    308308                return XT_ABORT;
     
    311311        if( strcmp( node->name, "success" ) == 0 )
    312312        {
    313                 imc_log( ic, "Authentication finished" );
     313                imcb_log( ic, "Authentication finished" );
    314314                jd->flags |= JFLAG_AUTHENTICATED | JFLAG_STREAM_RESTART;
    315315        }
    316316        else if( strcmp( node->name, "failure" ) == 0 )
    317317        {
    318                 imc_error( ic, "Authentication failure" );
     318                imcb_error( ic, "Authentication failure" );
    319319                imc_logout( ic, FALSE );
    320320                return XT_ABORT;
Note: See TracChangeset for help on using the changeset viewer.