Changeset 0fbd3a6d for nick.c


Ignore:
Timestamp:
2007-12-19T00:24:32Z (17 years ago)
Author:
ulim <a.sporto+bee@…>
Branches:
master
Children:
1ba7e8f
Parents:
793cc25 (diff), 2379566 (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the (diff) links above to see all the changes relative to each parent.
Message:

Now with sending via a proxy. The proxy is automatically discovered from your
jabber server.

Also merged in revs 279..288 from upstream (e.g. PING)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • nick.c

    r793cc25 r0fbd3a6d  
    154154   With one difference, we allow dashes. */
    155155
    156 static char *nick_lc_chars = "0123456789abcdefghijklmnopqrstuvwxyz{}^-_|";
    157 static char *nick_uc_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[]~-_\\";
    158 
    159 void nick_strip( char * nick )
     156static char *nick_lc_chars = "0123456789abcdefghijklmnopqrstuvwxyz{}^`-_|";
     157static char *nick_uc_chars = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ[]~`-_\\";
     158
     159void nick_strip( char *nick )
    160160{
    161161        int i, j;
     
    170170                }
    171171        }
     172        if( isdigit( nick[0] ) )
     173        {
     174                char *orig;
     175               
     176                orig = g_strdup( nick );
     177                g_snprintf( nick, MAX_NICK_LENGTH, "_%s", orig );
     178                g_free( orig );
     179                j ++;
     180        }
    172181        while( j <= MAX_NICK_LENGTH )
    173182                nick[j++] = '\0';
     
    178187        const char *s;
    179188       
    180         /* Empty/long nicks are not allowed */
    181         if( !*nick || strlen( nick ) > MAX_NICK_LENGTH )
     189        /* Empty/long nicks are not allowed, nor numbers at [0] */
     190        if( !*nick || isdigit( nick[0] ) || strlen( nick ) > MAX_NICK_LENGTH )
    182191                return( 0 );
    183192       
Note: See TracChangeset for help on using the changeset viewer.