From a4d920bfc34db9ca9161ff3817385423e52b8c90 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 7 Jun 2010 17:48:11 +0100 Subject: Added "channel del". --- root_commands.c | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) (limited to 'root_commands.c') diff --git a/root_commands.c b/root_commands.c index a9106781..12e89b32 100644 --- a/root_commands.c +++ b/root_commands.c @@ -555,6 +555,24 @@ static void cmd_channel( irc_t *irc, char **cmd ) } irc_usermsg( irc, "End of channel list" ); } + else if( g_strcasecmp( cmd[1], "del" ) == 0 ) + { + irc_channel_t *ic; + + MIN_ARGS( 2 ); + + if( ( ic = irc_channel_get( irc, cmd[2] ) ) && + !( ic->flags & IRC_CHANNEL_JOINED ) && + ic != ic->irc->default_channel ) + { + irc_usermsg( irc, "Channel %s deleted.", ic->name ); + irc_channel_free( ic ); + } + else + irc_usermsg( irc, "Couldn't remove channel (main channel %s or " + "channels you're still in cannot be deleted).", + ic->irc->default_channel->name ); + } else { irc_usermsg( irc, "Unknown command: %s %s. Please use \x02help commands\x02 to get a list of available commands.", "channel", cmd[1] ); -- cgit v1.2.3