aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--irc_commands.c17
1 files changed, 12 insertions, 5 deletions
diff --git a/irc_commands.c b/irc_commands.c
index 57268d07..b1b764b9 100644
--- a/irc_commands.c
+++ b/irc_commands.c
@@ -72,11 +72,7 @@ static void irc_cmd_user( irc_t *irc, char **cmd )
static void irc_cmd_nick( irc_t *irc, char **cmd )
{
- if( irc->user->nick )
- {
- irc_send_num( irc, 438, ":The hand of the deity is upon thee, thy nick may not change" );
- }
- else if( irc_user_by_name( irc, cmd[1] ) )
+ if( irc_user_by_name( irc, cmd[1] ) )
{
irc_send_num( irc, 433, ":This nick is already in use" );
}
@@ -85,6 +81,17 @@ static void irc_cmd_nick( irc_t *irc, char **cmd )
/* [SH] Invalid characters. */
irc_send_num( irc, 432, ":This nick contains invalid characters" );
}
+ else if( irc->user->nick )
+ {
+ if( irc->status & USTATUS_IDENTIFIED )
+ {
+ irc_setpass( irc, NULL );
+ irc->status &= ~USTATUS_IDENTIFIED;
+ irc_umode_set( irc, "-R", 1 );
+ }
+
+ irc_user_set_nick( irc->user, cmd[1] );
+ }
else
{
irc->user->nick = g_strdup( cmd[1] );