Changeset 36562b0 for root_commands.c


Ignore:
Timestamp:
2010-06-07T00:44:45Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
0d9d53e
Parents:
92cb8c4
Message:

Added "channel list" command and the ability to use only part of the
channel name or a number in "chan set"/etc.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • root_commands.c

    r92cb8c4 r36562b0  
    522522        irc_channel_t *ic;
    523523       
    524         if( ( ic = irc_channel_by_name( irc, id ) ) )
     524        if( ( ic = irc_channel_get( irc, id ) ) )
    525525                return &ic->set;
    526526        else
     
    535535               
    536536                cmd_set_real( irc, cmd + 1, cmd_channel_set_findhead, NULL );
     537        }
     538        else if( g_strcasecmp( cmd[1], "list" ) == 0 )
     539        {
     540                GSList *l;
     541                int i = 0;
     542               
     543                if( strchr( irc->umode, 'b' ) )
     544                        irc_usermsg( irc, "Channel list:" );
     545               
     546                for( l = irc->channels; l; l = l->next )
     547                {
     548                        irc_channel_t *ic = l->data;
     549                       
     550                        irc_usermsg( irc, "%2d. %s, %s channel%s", i, ic->name,
     551                                     set_getstr( &ic->set, "type" ),
     552                                     ic->flags & IRC_CHANNEL_JOINED ? " (joined)" : "" );
     553                       
     554                        i ++;
     555                }
     556                irc_usermsg( irc, "End of channel list" );
    537557        }
    538558        else
Note: See TracChangeset for help on using the changeset viewer.