diff options
Diffstat (limited to 'root_commands.c')
-rw-r--r-- | root_commands.c | 22 |
1 files changed, 21 insertions, 1 deletions
diff --git a/root_commands.c b/root_commands.c index bb9b26cd..72dec6f1 100644 --- a/root_commands.c +++ b/root_commands.c @@ -521,7 +521,7 @@ static set_t **cmd_channel_set_findhead( irc_t *irc, char *id ) { irc_channel_t *ic; - if( ( ic = irc_channel_by_name( irc, id ) ) ) + if( ( ic = irc_channel_get( irc, id ) ) ) return &ic->set; else return NULL; @@ -535,6 +535,26 @@ static void cmd_channel( irc_t *irc, char **cmd ) cmd_set_real( irc, cmd + 1, cmd_channel_set_findhead, NULL ); } + else if( g_strcasecmp( cmd[1], "list" ) == 0 ) + { + GSList *l; + int i = 0; + + if( strchr( irc->umode, 'b' ) ) + irc_usermsg( irc, "Channel list:" ); + + for( l = irc->channels; l; l = l->next ) + { + irc_channel_t *ic = l->data; + + irc_usermsg( irc, "%2d. %s, %s channel%s", i, ic->name, + set_getstr( &ic->set, "type" ), + ic->flags & IRC_CHANNEL_JOINED ? " (joined)" : "" ); + + i ++; + } + irc_usermsg( irc, "End of channel list" ); + } else { irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "channel", cmd[1] ); |