Changeset 9cb9868


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

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

Files:
8 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r9a103a2 r9cb9868  
    24412441        ret->alias_buddy = jabber_roster_update;
    24422442        ret->group_buddy = jabber_group_change;
     2443        ret->cmp_buddynames = g_strcasecmp;
    24432444
    24442445        my_protocol = ret;
  • protocols/msn/msn.c

    r9a103a2 r9cb9868  
    398398        ret->rem_deny = msn_rem_deny;
    399399        ret->send_typing = msn_send_typing;
     400        ret->cmp_buddynames = g_strcasecmp;
    400401
    401402        my_protocol = ret;
  • 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 );
  • protocols/nogaim.h

    r9a103a2 r9cb9868  
    220220
    221221        char *(* get_status_string) (struct gaim_connection *gc, int stat);
     222
     223        int (* cmp_buddynames) (const char *who1, const char *who2);
    222224};
    223225
     
    259261int proto_away( struct gaim_connection *gc, char *away );
    260262char *set_eval_away_devoice( irc_t *irc, set_t *set, char *value );
    261 int handle_cmp( char *a, char *b, int protocol );
    262263
    263264gboolean auto_reconnect( gpointer data );
  • protocols/oscar/oscar.c

    r9a103a2 r9cb9868  
    12101210        return 1;
    12111211}
    1212 /*
    1213 int handle_cmp_aim(const char * a, const char * b) {
    1214         return handle_cmp(a, b, PROTO_TOC);
    1215 }
    1216 */
     1212
    12171213static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) {
    12181214        int channel, ret = 0;
     
    24862482        ret->set_permit_deny = oscar_set_permit_deny;
    24872483        ret->keepalive = oscar_keepalive;
     2484        ret->cmp_buddynames = aim_sncmp;
    24882485        ret->get_status_string = oscar_get_status_string;
    24892486
  • protocols/oscar/oscar_util.c

    r9a103a2 r9cb9868  
    1 /*
    2  *
    3  *
    4  *
    5  */
    6 
    71#include <aim.h>
    82#include <ctype.h>
  • protocols/yahoo/yahoo.c

    r9a103a2 r9cb9868  
    417417        ret->chat_leave = byahoo_chat_leave;
    418418        ret->chat_open = byahoo_chat_open;
     419        ret->cmp_buddynames = g_strcasecmp;
    419420       
    420421        my_protocol = ret;
  • user.c

    r9a103a2 r9cb9868  
    146146        while( u )
    147147        {
    148                 if( u->gc == gc && u->handle && handle_cmp( u->handle, handle, gc->protocol ) == 0 )
     148                if( u->gc == gc && u->handle && gc->prpl->cmp_buddynames ( u->handle, handle ) == 0 )
    149149                        break;
    150150                u = u->next;
Note: See TracChangeset for help on using the changeset viewer.