Changeset bf02a67 for commands.c


Ignore:
Timestamp:
2005-12-15T11:55:27Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
15832cc, bd69a21
Parents:
11e090b (diff), 547f937 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Merged Jelmer's pluginable tree (mainly useful for the Win32 port).

File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    r11e090b rbf02a67  
    166166        if( g_strcasecmp( cmd[1], "add" ) == 0 )
    167167        {
    168                 int prot;
     168                struct prpl *prpl;
    169169               
    170170                if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL )
     
    174174                }
    175175               
    176                 for( prot = 0; prot < PROTO_MAX; prot ++ )
    177                         if( proto_name[prot] && *proto_name[prot] && g_strcasecmp( proto_name[prot], cmd[2] ) == 0 )
    178                                 break;
    179                
    180                 if( ( prot == PROTO_MAX ) || ( proto_prpl[prot] == NULL ) )
     176                prpl = find_protocol(cmd[2]);
     177               
     178                if( prpl == NULL )
    181179                {
    182180                        irc_usermsg( irc, "Unknown protocol" );
     
    184182                }
    185183
    186                 if( prot == PROTO_OSCAR && cmd[5] == NULL )
    187                 {
    188                         irc_usermsg( irc, "Not enough parameters" );
    189                         return( 0 );
    190                 }
    191                
    192                 a = account_add( irc, prot, cmd[3], cmd[4] );
     184                a = account_add( irc, prpl, cmd[3], cmd[4] );
    193185               
    194186                if( cmd[5] )
     
    234226                                con = "";
    235227                       
    236                         if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC )
    237                                 irc_usermsg( irc, "%2d. OSCAR, %s on %s%s", i, a->user, a->server, con );
    238                         else
    239                                 irc_usermsg( irc, "%2d. %s, %s%s", i, proto_name[a->protocol], a->user, con );
     228                        irc_usermsg( irc, "%2d. %s, %s%s", i, a->prpl->name, a->user, con );
    240229                       
    241230                        i ++;
     
    354343                else
    355344                {
    356                         nick_set( irc, cmd[2], a->gc->protocol, cmd[3] );
     345                        nick_set( irc, cmd[2], a->gc->prpl, cmd[3] );
    357346                }
    358347        }
     
    435424        else if( u->send_handler == buddy_send_handler )
    436425        {
    437                 nick_set( irc, u->handle, u->gc->protocol, cmd[2] );
     426                nick_set( irc, u->handle, u->gc->prpl, cmd[2] );
    438427        }
    439428       
     
    646635        if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away )
    647636        {
    648                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     637                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    649638                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, "Online" );
    650639                n_online ++;
     
    653642        if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away )
    654643        {
    655                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     644                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    656645                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, u->away );
    657646                n_away ++;
     
    660649        if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online )
    661650        {
    662                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     651                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    663652                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, "Offline" );
    664653                n_offline ++;
     
    721710        for( num = 0; q; q = q->next, num ++ )
    722711                if( q->gc ) /* Not necessary yet, but it might come later */
    723                         irc_usermsg( irc, "%d, %s(%s): %s", num, proto_name[q->gc->protocol], q->gc->username, q->question );
     712                        irc_usermsg( irc, "%d, %s(%s): %s", num, q->gc->prpl->name, q->gc->username, q->question );
    724713                else
    725714                        irc_usermsg( irc, "%d, BitlBee: %s", num, q->question );
     
    769758        for( n = gc->irc->nicks; n; n = n->next )
    770759        {
    771                 if( n->proto == gc->protocol && !user_findhandle( gc, n->handle ) )
     760                if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) )
    772761                {
    773762                        gc->prpl->add_buddy( gc, n->handle );
Note: See TracChangeset for help on using the changeset viewer.