Ignore:
Timestamp:
2007-04-20T04:49:30Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
61ae52c
Parents:
f0cb961
Message:

New code to use nicknames stored in ICQ contact lists.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    rf0cb961 rd323394c  
    372372       
    373373        memset( nick, 0, MAX_NICK_LENGTH + 1 );
    374         strcpy( nick, nick_get( ic->acc, handle, NULL ) );
     374        strcpy( nick, nick_get( ic->acc, handle ) );
    375375       
    376376        u = user_add( ic->irc, nick );
     
    426426}
    427427
    428 
    429428void imcb_rename_buddy( struct im_connection *ic, char *handle, char *realname )
    430429{
    431430        user_t *u = user_findhandle( ic, handle );
     431        char *s, newnick[MAX_NICK_LENGTH+1];
    432432       
    433433        if( !u || !realname ) return;
     
    441441                if( ( ic->flags & OPT_LOGGED_IN ) && set_getbool( &ic->irc->set, "display_namechanges" ) )
    442442                        imcb_log( ic, "User `%s' changed name to `%s'", u->nick, u->realname );
     443               
     444                if( !u->online && !nick_saved( ic->acc, handle ) )
     445                {
     446                        /* Detect numeric handles: */
     447                        for( s = u->user; isdigit( *s ); s++ );
     448                       
     449                        if( *s == 0 )
     450                        {
     451                                /* If we reached the end of the string, it only contained numbers.
     452                                   Seems to be an ICQ# then, so hopefully realname contains
     453                                   something more useful. */
     454                                strcpy( newnick, realname );
     455                               
     456                                /* Some processing to make sure this string is a valid IRC nickname. */
     457                                nick_strip( newnick );
     458                                if( set_getbool( &ic->irc->set, "lcnicks" ) )
     459                                        nick_lc( newnick );
     460                               
     461                                u->nick = g_strdup( newnick );
     462                        }
     463                }
    443464        }
    444465}
Note: See TracChangeset for help on using the changeset viewer.