aboutsummaryrefslogtreecommitdiffstats
path: root/protocols/nogaim.c
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2007-07-02 22:07:43 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2007-07-02 22:07:43 +0100
commit1962ac169c14c7b24e276caac0976b8983496fd5 (patch)
treeda8cbf25df48c9d8df20cddf622647ad7a7684dc /protocols/nogaim.c
parentc3774175d29802202afb226a2661d0c3c52fb7b1 (diff)
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).
Diffstat (limited to 'protocols/nogaim.c')
-rw-r--r--protocols/nogaim.c20
1 files changed, 13 insertions, 7 deletions
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 );
+ }
}
}