Changeset 9a9b520
- Timestamp:
- 2010-07-08T22:31:01Z (14 years ago)
- Branches:
- master
- Children:
- b556e46, f3b6764
- Parents:
- 69b896b
- Files:
-
- 3 edited
Legend:
- Unmodified
- Added
- Removed
-
irc_commands.c
r69b896b r9a9b520 72 72 static void irc_cmd_nick( irc_t *irc, char **cmd ) 73 73 { 74 if( irc_user_by_name( irc, cmd[1] ) ) 75 { 76 irc_send_num( irc, 433, ":This nick is already in use" ); 74 irc_user_t *iu; 75 76 if( ( iu = irc_user_by_name( irc, cmd[1] ) ) && iu != irc->user ) 77 { 78 irc_send_num( irc, 433, "%s :This nick is already in use", cmd[1] ); 77 79 } 78 80 else if( !nick_ok( cmd[1] ) ) 79 81 { 80 82 /* [SH] Invalid characters. */ 81 irc_send_num( irc, 432, " :This nick contains invalid characters");82 } 83 else if( irc-> user->nick)83 irc_send_num( irc, 432, "%s :This nick contains invalid characters", cmd[1] ); 84 } 85 else if( irc->status & USTATUS_LOGGED_IN ) 84 86 { 85 87 if( irc->status & USTATUS_IDENTIFIED ) … … 98 100 else 99 101 { 102 g_free( irc->user->nick ); 100 103 irc->user->nick = g_strdup( cmd[1] ); 101 104 -
irc_user.c
r69b896b r9a9b520 120 120 { 121 121 irc_t *irc = iu->irc; 122 irc_user_t *new_iu; 122 123 char key[strlen(new)+1]; 123 124 GSList *cl; 124 125 125 126 strcpy( key, new ); 126 if( iu == NULL || !nick_lc( key ) || irc_user_by_name( irc, new ) ) 127 if( iu == NULL || !nick_lc( key ) || 128 ( ( new_iu = irc_user_by_name( irc, new ) ) && new_iu != iu ) ) 127 129 return 0; 128 130 -
root_commands.c
r69b896b r9a9b520 662 662 static void cmd_rename( irc_t *irc, char **cmd ) 663 663 { 664 irc_user_t *iu ;664 irc_user_t *iu, *old; 665 665 666 666 iu = irc_user_by_name( irc, cmd[1] ); … … 678 678 irc_usermsg( irc, "Nick `%s' is invalid", cmd[2] ); 679 679 } 680 else if( irc_user_by_name( irc, cmd[2] ))680 else if( ( old = irc_user_by_name( irc, cmd[2] ) ) && old != iu ) 681 681 { 682 682 irc_usermsg( irc, "Nick `%s' already exists", cmd[2] );
Note: See TracChangeset
for help on using the changeset viewer.