Changeset 7b23afd for commands.c


Ignore:
Timestamp:
2005-11-07T16:16:18Z (19 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
f7f3ada
Parents:
fe51bcf
Message:

Migrate my pluginable branch to use Wilmers' branch as parent

File:
1 edited

Legend:

Unmodified
Added
Removed
  • commands.c

    rfe51bcf r7b23afd  
    185185        if( g_strcasecmp( cmd[1], "add" ) == 0 )
    186186        {
    187                 int prot;
     187                struct prpl *prpl;
    188188               
    189189                if( cmd[2] == NULL || cmd[3] == NULL || cmd[4] == NULL )
     
    193193                }
    194194               
    195                 for( prot = 0; prot < PROTO_MAX; prot ++ )
    196                         if( proto_name[prot] && *proto_name[prot] && g_strcasecmp( proto_name[prot], cmd[2] ) == 0 )
    197                                 break;
    198                
    199                 if( ( prot == PROTO_MAX ) || ( proto_prpl[prot] == NULL ) )
     195                prpl = find_protocol(cmd[2]);
     196               
     197                if( prpl == NULL )
    200198                {
    201199                        irc_usermsg( irc, "Unknown protocol" );
     
    203201                }
    204202
    205                 if( prot == PROTO_OSCAR && cmd[5] == NULL )
    206                 {
    207                         irc_usermsg( irc, "Not enough parameters" );
    208                         return( 0 );
    209                 }
    210                
    211                 a = account_add( irc, prot, cmd[3], cmd[4] );
     203                a = account_add( irc, prpl, cmd[3], cmd[4] );
    212204               
    213205                if( cmd[5] )
     
    253245                                con = "";
    254246                       
    255                         if( a->protocol == PROTO_OSCAR || a->protocol == PROTO_ICQ || a->protocol == PROTO_TOC )
    256                                 irc_usermsg( irc, "%2d. OSCAR, %s on %s%s", i, a->user, a->server, con );
    257                         else
    258                                 irc_usermsg( irc, "%2d. %s, %s%s", i, proto_name[a->protocol], a->user, con );
     247                        irc_usermsg( irc, "%2d. %s, %s%s", i, a->prpl->name, a->user, con );
    259248                       
    260249                        i ++;
     
    373362                else
    374363                {
    375                         nick_set( irc, cmd[2], a->gc->protocol, cmd[3] );
     364                        nick_set( irc, cmd[2], a->gc->prpl, cmd[3] );
    376365                }
    377366        }
     
    454443        else if( u->send_handler == buddy_send_handler )
    455444        {
    456                 nick_set( irc, u->handle, u->gc->protocol, cmd[2] );
     445                nick_set( irc, u->handle, u->gc->prpl, cmd[2] );
    457446        }
    458447       
     
    665654        if( online == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && !u->away )
    666655        {
    667                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     656                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    668657                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, "Online" );
    669658                n_online ++;
     
    672661        if( away == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && u->online && u->away )
    673662        {
    674                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     663                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    675664                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, u->away );
    676665                n_away ++;
     
    679668        if( offline == 1 ) for( u = irc->users; u; u = u->next ) if( u->gc && !u->online )
    680669        {
    681                 g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, proto_name[u->gc->user->protocol] );
     670                g_snprintf( s, 63, "%s@%s (%s)", u->user, u->host, u->gc->user->prpl->name );
    682671                irc_usermsg( irc, "%-16.16s  %-40.40s  %s", u->nick, s, "Offline" );
    683672                n_offline ++;
     
    785774        for( n = gc->irc->nicks; n; n = n->next )
    786775        {
    787                 if( n->proto == gc->protocol && !user_findhandle( gc, n->handle ) )
     776                if( n->proto == gc->prpl && !user_findhandle( gc, n->handle ) )
    788777                {
    789778                        gc->prpl->add_buddy( gc, n->handle );
Note: See TracChangeset for help on using the changeset viewer.