Changeset 9cb9868 for protocols/nogaim.c


Ignore:
Timestamp:
2005-11-15T14:47:17Z (18 years ago)
Author:
Jelmer Vernooij <jelmer@…>
Branches:
master
Children:
5c09a59, c998255
Parents:
9a103a2
Message:

Remove handle_cmp() replacing it by a protocol-specific function.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/nogaim.c

    r9a103a2 r9cb9868  
    162162        return( NULL );
    163163}
    164 
    165 /* Compare two handles for a specific protocol. For most protocols,
    166    g_strcasecmp is okay, but for AIM, for example, it's not. This really
    167    should be a compare function inside the PRPL module, but I do it this
    168    way for now because I don't want to touch the Gaim code too much since
    169    it's not going to be here for too long anymore. */
    170 int handle_cmp( char *a, char *b, int protocol )
    171 {
    172         if( protocol == PROTO_TOC || protocol == PROTO_ICQ )
    173         {
    174                 /* AIM, being teh evil, thinks it's cool that users can put
    175                    random spaces in screennames. But "A B" and "AB" are
    176                    equal. Hrmm, okay. */
    177                 while( 1 )
    178                 {
    179                         while( *a == ' ' ) a ++;
    180                         while( *b == ' ' ) b ++;
    181                        
    182                         if( *a && *b )
    183                         {
    184                                 if( tolower( *a ) != tolower( *b ) )
    185                                         return( 1 );
    186                         }
    187                         else if( *a || *b )
    188                                 return( 1 );
    189                         else
    190                                 return( 0 );
    191                        
    192                         a ++;
    193                         b ++;
    194                 }
    195         }
    196         else
    197         {
    198                 return( g_strcasecmp( a, b ) );
    199         }
    200 }
    201 
    202164
    203165/* multi.c */
     
    836798       
    837799        /* It might be yourself! */
    838         if( handle_cmp ( handle, b->gc->user->username, b->gc->protocol ) == 0 )
     800        if( b->gc->prpl->cmp_buddynames( handle, b->gc->user->username ) == 0 )
    839801        {
    840802                u = user_find( b->gc->irc, b->gc->irc->nick );
Note: See TracChangeset for help on using the changeset viewer.