Index: irc_im.c
===================================================================
--- irc_im.c	(revision 619dd1882deb7f507882748982744cc275dd92a9)
+++ irc_im.c	(revision 6ef906557277b71fc278e3f612542bd4d7d75ab5)
@@ -220,4 +220,6 @@
 }
 
+static gboolean bee_irc_user_nick_hint( bee_t *bee, bee_user_t *bu, const char *hint );
+
 static gboolean bee_irc_user_fullname( bee_t *bee, bee_user_t *bu )
 {
@@ -253,7 +255,48 @@
 		}
 		
-		imcb_buddy_nick_hint( bu->ic, bu->handle, name );
+		bee_irc_user_nick_hint( bee, bu, name );
 		
 		g_free( name );
+	}
+	
+	return TRUE;
+}
+
+static gboolean bee_irc_user_nick_hint( bee_t *bee, bee_user_t *bu, const char *hint )
+{
+	irc_user_t *iu = bu->ui_data;
+	char newnick[MAX_NICK_LENGTH+1], *translit;
+	
+	if( bu->flags & BEE_USER_ONLINE )
+		/* Ignore if the user is visible already. */
+		return TRUE;
+	
+	if( nick_saved( bu->ic->acc, bu->handle ) )
+		/* The user already assigned a nickname to this person. */
+		return TRUE;
+	
+	/* Credits to Josay_ in #bitlbee for this idea. //TRANSLIT should
+	   do lossy/approximate conversions, so letters with accents don't
+	   just get stripped. Note that it depends on LC_CTYPE being set to
+	   something other than C/POSIX. */
+	translit = g_convert( hint, -1, "ASCII//TRANSLIT//IGNORE", "UTF-8",
+	                      NULL, NULL, NULL );
+	
+	strncpy( newnick, translit ? : hint, MAX_NICK_LENGTH );
+	newnick[MAX_NICK_LENGTH] = 0;
+	g_free( translit );
+	
+	/* Some processing to make sure this string is a valid IRC nickname. */
+	nick_strip( newnick );
+	if( set_getbool( &bee->set, "lcnicks" ) )
+		nick_lc( newnick );
+	
+	if( strcmp( iu->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( bu->ic->acc, bu->handle, newnick );
+		irc_user_set_nick( iu, newnick );
 	}
 	
@@ -722,4 +765,5 @@
 	bee_irc_user_free,
 	bee_irc_user_fullname,
+	bee_irc_user_nick_hint,
 	bee_irc_user_group,
 	bee_irc_user_status,
Index: protocols/bee.h
===================================================================
--- protocols/bee.h	(revision 619dd1882deb7f507882748982744cc275dd92a9)
+++ protocols/bee.h	(revision 6ef906557277b71fc278e3f612542bd4d7d75ab5)
@@ -85,4 +85,5 @@
 	gboolean (*user_free)( bee_t *bee, struct bee_user *bu );
 	gboolean (*user_fullname)( bee_t *bee, bee_user_t *bu );
+	gboolean (*user_nick_hint)( bee_t *bee, bee_user_t *bu, const char *hint );
 	gboolean (*user_group)( bee_t *bee, bee_user_t *bu );
 	gboolean (*user_status)( bee_t *bee, struct bee_user *bu, struct bee_user *old );
Index: protocols/nogaim.c
===================================================================
--- protocols/nogaim.c	(revision 619dd1882deb7f507882748982744cc275dd92a9)
+++ protocols/nogaim.c	(revision 6ef906557277b71fc278e3f612542bd4d7d75ab5)
@@ -418,37 +418,11 @@
 void imcb_buddy_nick_hint( struct im_connection *ic, const char *handle, const char *nick )
 {
-#if 0
-	user_t *u = user_findhandle( ic, handle );
-	char newnick[MAX_NICK_LENGTH+1], *orig_nick;
-	
-	if( u && !u->online && !nick_saved( ic->acc, handle ) )
-	{
-		/* Only do this if the person isn't online yet (which should
-		   be the case if we just added it) and if the user hasn't
-		   assigned a nickname to this buddy already. */
-		
-		strncpy( newnick, nick, MAX_NICK_LENGTH );
-		newnick[MAX_NICK_LENGTH] = 0;
-		
-		/* Some processing to make sure this string is a valid IRC nickname. */
-		nick_strip( newnick );
-		if( set_getbool( &ic->bee->set, "lcnicks" ) )
-			nick_lc( newnick );
-		
-		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 );
-		}
-	}
-#endif
+	bee_t *bee = ic->bee;
+	bee_user_t *bu = bee_user_by_handle( bee, ic, handle );
+	
+	if( !bu || !nick ) return;
+	
+	if( bee->ui->user_nick_hint )
+		bee->ui->user_nick_hint( bee, bu, nick );
 }
 
