From 1962ac169c14c7b24e276caac0976b8983496fd5 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 2 Jul 2007 22:07:43 +0100 Subject: Fixed nick hint function to only set the nick if it's different from the current one (otherwise the dedupe function will dedupe the nick against itself). --- protocols/nogaim.c | 20 +++++++++++++------- 1 file changed, 13 insertions(+), 7 deletions(-) (limited to 'protocols') diff --git a/protocols/nogaim.c b/protocols/nogaim.c index 4f04993c..22d82ecb 100644 --- a/protocols/nogaim.c +++ b/protocols/nogaim.c @@ -470,13 +470,19 @@ void imcb_buddy_nick_hint( struct im_connection *ic, char *handle, char *nick ) if( set_getbool( &ic->irc->set, "lcnicks" ) ) nick_lc( newnick ); - nick_dedupe( ic->acc, handle, newnick ); - - /* u->nick will be freed halfway the process, so it can't be - passed as an argument. */ - orig_nick = g_strdup( u->nick ); - user_rename( ic->irc, orig_nick, newnick ); - g_free( orig_nick ); + if( strcmp( u->nick, newnick ) != 0 ) + { + /* Only do this if newnick is different from the current one. + If rejoining a channel, maybe we got this nick already + (and dedupe would only add an underscore. */ + nick_dedupe( ic->acc, handle, newnick ); + + /* u->nick will be freed halfway the process, so it can't be + passed as an argument. */ + orig_nick = g_strdup( u->nick ); + user_rename( ic->irc, orig_nick, newnick ); + g_free( orig_nick ); + } } } -- cgit v1.2.3