diff options
| author | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-29 21:18:12 +0100 | 
|---|---|---|
| committer | Wilmer van der Gaast <wilmer@gaast.net> | 2011-12-29 21:18:12 +0100 | 
| commit | 3558feab3c18f12abdd1e927e1f20969850abd15 (patch) | |
| tree | 1be835a1cf665dc0fb006f6618ccdac7c73e7dde | |
| parent | f1849a8c230909bc0a67faf2ff89d3b4f85ad242 (diff) | |
When changing nicks and the change is case-only (or no change *at all*),
do not reset identify status. Bug #880.
| -rw-r--r-- | irc_commands.c | 8 | 
1 files changed, 6 insertions, 2 deletions
| diff --git a/irc_commands.c b/irc_commands.c index 52cf31d0..18a7acd5 100644 --- a/irc_commands.c +++ b/irc_commands.c @@ -86,7 +86,10 @@ static void irc_cmd_nick( irc_t *irc, char **cmd )  	}  	else if( irc->status & USTATUS_LOGGED_IN )  	{ -		if( irc->status & USTATUS_IDENTIFIED ) +		/* WATCH OUT: iu from the first if reused here to check if the +		   new nickname is the same (other than case, possibly). If it +		   is, no need to reset identify-status. */ +		if( ( irc->status & USTATUS_IDENTIFIED ) && iu != irc->user )  		{  			irc_setpass( irc, NULL );  			irc->status &= ~USTATUS_IDENTIFIED; @@ -97,7 +100,8 @@ static void irc_cmd_nick( irc_t *irc, char **cmd )  			             "nick_changes\x02." );  		} -		irc_user_set_nick( irc->user, cmd[1] ); +		if( strcmp( cmd[1], irc->user->nick ) != 0 ) +			irc_user_set_nick( irc->user, cmd[1] );  	}  	else  	{ | 
