diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-07 17:48:11 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2010-06-07 17:48:11 +0100 | 
| commit | a4d920bfc34db9ca9161ff3817385423e52b8c90 (patch) | |
| tree | 8b2381410422ca18904a0ceb1f6a55676b3ab5f9 /root_commands.c | |
| parent | 0a6e5d1fd4e0c33e0529db7f94aae66b3f995f84 (diff) | |
Added "channel del".
Diffstat (limited to 'root_commands.c')
| -rw-r--r-- | root_commands.c | 18 | 
1 files changed, 18 insertions, 0 deletions
| 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] ); | 
