Changeset d323394c for nick.c


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
  • nick.c

    rf0cb961 rd323394c  
    22  * BitlBee -- An IRC to other IM-networks gateway                     *
    33  *                                                                    *
    4   * Copyright 2002-2006 Wilmer van der Gaast and others                *
     4  * Copyright 2002-2007 Wilmer van der Gaast and others                *
    55  \********************************************************************/
    66
     
    5353}
    5454
    55 char *nick_get( account_t *acc, const char *handle, const char *realname )
     55char *nick_get( account_t *acc, const char *handle )
    5656{
    5757        static char nick[MAX_NICK_LENGTH+1];
     
    7676                        while( *s )
    7777                                *(s++) = 0;
    78                
    79                 /* All-digit handles (mainly ICQ UINs) aren't cool, try to
    80                    use the realname instead. */
    81                 for( s = nick; *s && isdigit( *s ); s ++ );
    82                 if( !*s && realname && *realname )
    83                         g_snprintf( nick, MAX_NICK_LENGTH, "%s", realname );
    8478               
    8579                nick_strip( nick );
     
    130124}
    131125
     126/* Just check if there is a nickname set for this buddy or if we'd have to
     127   generate one. */
     128int nick_saved( account_t *acc, const char *handle )
     129{
     130        char *store_handle, *found;
     131       
     132        store_handle = clean_handle( handle );
     133        found = g_hash_table_lookup( acc->nicks, store_handle );
     134        g_free( store_handle );
     135       
     136        return found != NULL;
     137}
     138
    132139void nick_del( account_t *acc, const char *handle )
    133140{
     
    176183int nick_lc( char *nick )
    177184{
    178         static char tab[256] = { 0 };
     185        static char tab[128] = { 0 };
    179186        int i;
    180187       
Note: See TracChangeset for help on using the changeset viewer.