Changeset f0cb961 for protocols/oscar


Ignore:
Timestamp:
2007-04-19T06:03:43Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
d323394c
Parents:
33dc261
Message:

More API changes: buddy list management. imcb_add_buddy() is now a *real*
callback, it's only called from inside IM-modules. This makes sure a buddy
only gets added to the BitlBee structures if the add was successful. This
gets rid of the weirdness described in #55. Unfortunately for now this
change breaks A) automatic renaming of ICQ contacts (if there are names
stored in the contact list) B) add -tmp.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    r33dc261 rf0cb961  
    11191119        aim_ssi_auth_reply(od->sess, od->conn, uin, 1, "");
    11201120        // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
    1121         if(find_buddy(data->ic, uin) == NULL)
     1121        if(imcb_find_buddy(data->ic, uin) == NULL)
    11221122                imcb_ask_add(data->ic, uin, NULL);
    11231123       
     
    18751875        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    18761876        if (odata->icq) {
    1877                 struct buddy *budlight = find_buddy(g, who);
     1877                struct buddy *budlight = imcb_find_buddy(g, who);
    18781878                if (budlight)
    18791879                        if ((budlight->uc & 0xff80) >> 7)
     
    20132013                switch (curitem->type) {
    20142014                        case 0x0000: /* Buddy */
    2015                                 if ((curitem->name) && (!find_buddy(ic, curitem->name))) {
     2015                                if ((curitem->name) && (!imcb_find_buddy(ic, curitem->name))) {
    20162016                                        char *realname = NULL;
    20172017
     
    20192019                                                    realname = aim_gettlv_str(curitem->data, 0x0131, 1);
    20202020                                               
    2021                                         add_buddy(ic, NULL, curitem->name, realname);
     2021                                        imcb_add_buddy(ic, curitem->name, NULL);
    20222022                                       
    2023                                         if (realname)
    2024                                             g_free(realname);
     2023                                        if (realname) {
     2024                                                imcb_rename_buddy(ic, curitem->name, realname);
     2025                                                g_free(realname);
     2026                                        }
    20252027                                }
    20262028                                break;
     
    21052107                {
    21062108                        st = aimbs_get16( &fr->data );
    2107                         if( st == 0x0E )
     2109                        if( st == 0x00 )
     2110                        {
     2111                                imcb_add_buddy( sess->aux_data, list, NULL );
     2112                        }
     2113                        else if( st == 0x0E )
    21082114                        {
    21092115                                imcb_log( sess->aux_data, "Buddy %s can't be added without authorization, requesting authorization", list );
     
    21112117                                aim_ssi_auth_request( sess, fr->conn, list, "" );
    21122118                                aim_ssi_addbuddies( sess, fr->conn, OSCAR_GROUP, &list, 1, 1 );
     2119                        }
     2120                        else
     2121                        {
     2122                                imcb_error( sess->aux_data, "Error while adding buddy: 0x%04x", st );
    21132123                        }
    21142124                        list += strlen( list ) + 1;
Note: See TracChangeset for help on using the changeset viewer.