aboutsummaryrefslogtreecommitdiffstats
path: root/root_commands.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-12-05 12:28:07 +0000
committerWilmer van der Gaast <wilmer@gaast.net>2010-12-05 12:28:07 +0000
commita429907207d5b8b05463c72a9b8c880ba03ad921 (patch)
treee04d31c6dc6ee8461d3401cae386ab14167c1f43 /root_commands.c
parentfd65edb3a40d4c73130b0be8dfa08ae8092c6935 (diff)
rename -del
Diffstat (limited to 'root_commands.c')
-rw-r--r--root_commands.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/root_commands.c b/root_commands.c
index 207f9678..a7b626b8 100644
--- a/root_commands.c
+++ b/root_commands.c
@@ -773,13 +773,20 @@ static void cmd_info( irc_t *irc, char **cmd )
static void cmd_rename( irc_t *irc, char **cmd )
{
irc_user_t *iu, *old;
+ gboolean del = g_strcasecmp( cmd[1], "-del" ) == 0;
- iu = irc_user_by_name( irc, cmd[1] );
+ iu = irc_user_by_name( irc, cmd[del ? 2 : 1] );
if( iu == NULL )
{
irc_usermsg( irc, "Nick `%s' does not exist", cmd[1] );
}
+ else if( del )
+ {
+ if( iu->bu )
+ bee_irc_user_nick_reset( iu );
+ irc_usermsg( irc, "Nickname reset to `%s'", iu->nick );
+ }
else if( iu == irc->user )
{
irc_usermsg( irc, "Use /nick to change your own nickname" );