Changeset ccc595b for protocols/yahoo


Ignore:
Timestamp:
2010-07-24T13:04:00Z (14 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
c495217
Parents:
78e2eb7
Message:

Support buddy groups on Yahoo!

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/yahoo/yahoo.c

    r78e2eb7 rccc595b  
    271271{
    272272        struct byahoo_data *yd = (struct byahoo_data *) ic->proto_data;
    273        
    274         yahoo_add_buddy( yd->y2_id, who, group ? group : BYAHOO_DEFAULT_GROUP, NULL );
     273        bee_user_t *bu;
     274       
     275        if( group && ( bu = bee_user_by_handle( ic->bee, ic, who ) ) && bu->group )
     276        {
     277                GSList *bgl;
     278               
     279                /* If the person is in our list already, this is a group change. */
     280                yahoo_change_buddy_group( yd->y2_id, who, bu->group->name, group );
     281               
     282                /* No idea how often people have people in multiple groups and
     283                   BitlBee doesn't currently support this anyway .. but keep
     284                   this struct up-to-date for now. */
     285                for( bgl = yd->buddygroups; bgl; bgl = bgl->next )
     286                {
     287                        struct byahoo_buddygroups *bg = bgl->data;
     288                       
     289                        if( g_strcasecmp( bg->buddy, who ) == 0 &&
     290                            g_strcasecmp( bg->group, bu->group->name ) == 0 )
     291                        {
     292                                g_free( bg->group );
     293                                bg->group = g_strdup( group );
     294                        }
     295                }
     296        }
     297        else
     298                yahoo_add_buddy( yd->y2_id, who, group ? group : BYAHOO_DEFAULT_GROUP, NULL );
    275299}
    276300
     
    780804                                       const char *old_group, const char *new_group )
    781805{
    782 }                               
     806        struct im_connection *ic = byahoo_get_ic_by_id( id );
     807       
     808        imcb_add_buddy( ic, who, new_group );
     809}
    783810
    784811/* Because we don't want asynchronous connects in BitlBee, and because
     
    9811008}
    9821009
    983 void ext_yahoo_got_ping( int id, const char *msg)
     1010void ext_yahoo_got_ping( int id, const char *msg )
    9841011{
    9851012}
Note: See TracChangeset for help on using the changeset viewer.