Changeset ffa1173


Ignore:
Timestamp:
2010-04-11T19:53:27Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
8240840
Parents:
dbb0ce3
Message:

Allow the user to change his/her nick. My old concern was that it gets hairy
when dealing with the storage/NickServ part. But meh, just reset all that
state when the nick changes and require the user to re-register if s/he
wants to save stuff.

The only problem's when s/he identifies and may end up getting every account
added twice.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • irc_commands.c

    rdbb0ce3 rffa1173  
    7373static void irc_cmd_nick( irc_t *irc, char **cmd )
    7474{
    75         if( irc->user->nick )
    76         {
    77                 irc_send_num( irc, 438, ":The hand of the deity is upon thee, thy nick may not change" );
    78         }
    79         else if( irc_user_by_name( irc, cmd[1] ) )
     75        if( irc_user_by_name( irc, cmd[1] ) )
    8076        {
    8177                irc_send_num( irc, 433, ":This nick is already in use" );
     
    8581                /* [SH] Invalid characters. */
    8682                irc_send_num( irc, 432, ":This nick contains invalid characters" );
     83        }
     84        else if( irc->user->nick )
     85        {
     86                if( irc->status & USTATUS_IDENTIFIED )
     87                {
     88                        irc_setpass( irc, NULL );
     89                        irc->status &= ~USTATUS_IDENTIFIED;
     90                        irc_umode_set( irc, "-R", 1 );
     91                }
     92               
     93                irc_user_set_nick( irc->user, cmd[1] );
    8794        }
    8895        else
Note: See TracChangeset for help on using the changeset viewer.