aboutsummaryrefslogtreecommitdiffstats
path: root/protocols
diff options
context:
space:
mode:
authorWilmer van der Gaast <wilmer@gaast.net>2010-06-07 22:09:33 +0100
committerWilmer van der Gaast <wilmer@gaast.net>2010-06-07 22:09:33 +0100
commit6ef906557277b71fc278e3f612542bd4d7d75ab5 (patch)
treecc7ed74c2c11ef8d8554ff154e24307cca9feaed /protocols
parent619dd1882deb7f507882748982744cc275dd92a9 (diff)
Restored nick_hint/nick_source functionality.
Diffstat (limited to 'protocols')
-rw-r--r--protocols/bee.h1
-rw-r--r--protocols/nogaim.c38
2 files changed, 7 insertions, 32 deletions
diff --git a/protocols/bee.h b/protocols/bee.h
index c57b4ab5..c3230f47 100644
--- a/protocols/bee.h
+++ b/protocols/bee.h
@@ -84,6 +84,7 @@ typedef struct bee_ui_funcs
gboolean (*user_new)( bee_t *bee, struct bee_user *bu );
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 );
gboolean (*user_msg)( bee_t *bee, bee_user_t *bu, const char *msg, time_t sent_at );
diff --git a/protocols/nogaim.c b/protocols/nogaim.c
index 499e4d1d..6ecdfe12 100644
--- a/protocols/nogaim.c
+++ b/protocols/nogaim.c
@@ -417,39 +417,13 @@ void imcb_remove_buddy( struct im_connection *ic, const char *handle, char *grou
modules to suggest a nickname for a handle. */
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;
+ bee_t *bee = ic->bee;
+ bee_user_t *bu = bee_user_by_handle( bee, ic, handle );
- 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
+ if( !bu || !nick ) return;
+
+ if( bee->ui->user_nick_hint )
+ bee->ui->user_nick_hint( bee, bu, nick );
}