Ignore:
Timestamp:
2010-07-24T21:16:18Z (15 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
f1f7b5e
Parents:
ef14a83 (diff), 593971d (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:

Merge ui-fix (which includes killerbee (i.e. file transfers and libpurple
support)). ui-fix rewrites the complete IRC core, fixing many things that
were broken/hacky/limited so far.

The list is too long to include here, but http://wiki.bitlbee.org/UiFix
has a summary, as does doc/CHANGES and of course the full revision history.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    ref14a83 r2945c6f  
    254254
    255255        u = t = g_strdup(s);
    256 
    257         strcpy(t, s);
    258256        g_strdown(t);
    259257
     
    290288        odata = (struct oscar_data *)ic->proto_data;
    291289
    292         if (condition & GAIM_INPUT_READ) {
     290        if (condition & B_EV_IO_READ) {
    293291                if (aim_get_command(odata->sess, conn) >= 0) {
    294292                        aim_rxdispatch(odata->sess);
     
    362360
    363361        aim_conn_completeconnect(sess, conn);
    364         ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
     362        ic->inpa = b_input_add(conn->fd, B_EV_IO_READ,
    365363                        oscar_callback, conn);
    366364       
     
    493491
    494492        aim_conn_completeconnect(sess, bosconn);
    495         ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
     493        ic->inpa = b_input_add(bosconn->fd, B_EV_IO_READ,
    496494                        oscar_callback, bosconn);
    497495        imcb_log(ic, _("Connection established, cookie sent"));
     
    652650        struct im_connection *ic = sess->aux_data;
    653651        struct chat_connection *chatcon;
     652        struct groupchat *c = NULL;
    654653        static int id = 1;
    655654
     
    664663        chatcon = find_oscar_chat_by_conn(ic, fr->conn);
    665664        chatcon->id = id;
    666         chatcon->cnv = imcb_chat_new(ic, chatcon->show);
     665       
     666        c = bee_chat_by_title(ic->bee, ic, chatcon->show);
     667        if (c && !c->data)
     668                chatcon->cnv = c;
     669        else
     670                chatcon->cnv = imcb_chat_new(ic, chatcon->show);
    667671        chatcon->cnv->data = chatcon;
    668672
     
    703707
    704708        aim_conn_completeconnect(sess, tstconn);
    705         odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
     709        odata->cnpa = b_input_add(tstconn->fd, B_EV_IO_READ,
    706710                                        oscar_callback, tstconn);
    707711       
     
    731735
    732736        aim_conn_completeconnect(sess, tstconn);
    733         odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
     737        odata->paspa = b_input_add(tstconn->fd, B_EV_IO_READ,
    734738                                oscar_callback, tstconn);
    735739       
     
    767771        aim_conn_completeconnect(sess, ccon->conn);
    768772        ccon->inpa = b_input_add(tstconn->fd,
    769                         GAIM_INPUT_READ,
     773                        B_EV_IO_READ,
    770774                        oscar_callback, tstconn);
    771775        odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
     
    934938        tmp = normalize(info->sn);
    935939        imcb_buddy_status(ic, tmp, flags, state_string, NULL);
    936         /* imcb_buddy_times(ic, tmp, signon, time_idle); */
     940        imcb_buddy_times(ic, tmp, signon, time_idle);
    937941
    938942
     
    10601064        aim_ssi_auth_reply(od->sess, od->conn, uin, 1, "");
    10611065        // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
    1062         if(imcb_find_buddy(data->ic, uin) == NULL)
    1063                 imcb_ask_add(data->ic, uin, NULL);
     1066        imcb_ask_add(data->ic, uin, NULL);
    10641067       
    10651068        g_free(uin);
     
    18221825        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    18231826        if (odata->icq) {
     1827                /** FIXME(wilmer): Hmm, lost the ability to get away msgs here, do we care to get that back?
    18241828                struct buddy *budlight = imcb_find_buddy(g, who);
    18251829                if (budlight)
     
    18271831                                if (budlight->caps & AIM_CAPS_ICQSERVERRELAY)
    18281832                                        aim_send_im_ch2_geticqmessage(odata->sess, who, (budlight->uc & 0xff80) >> 7);
     1833                */
    18291834        } else
    18301835                aim_getinfo(odata->sess, odata->conn, who, AIM_GETINFO_AWAYMESSAGE);
     
    19531958static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) {
    19541959        struct im_connection *ic = sess->aux_data;
    1955         struct aim_ssi_item *curitem;
     1960        struct aim_ssi_item *curitem, *curgroup;
    19561961        int tmp;
    19571962        char *nrm;
     
    19641969                switch (curitem->type) {
    19651970                        case 0x0000: /* Buddy */
    1966                                 if ((curitem->name) && (!imcb_find_buddy(ic, nrm))) {
     1971                                if ((curitem->name) && (!imcb_buddy_by_handle(ic, nrm))) {
    19671972                                        char *realname = NULL;
    19681973
    19691974                                        if (curitem->data && aim_gettlv(curitem->data, 0x0131, 1))
    19701975                                                    realname = aim_gettlv_str(curitem->data, 0x0131, 1);
    1971                                                
    1972                                         imcb_add_buddy(ic, nrm, NULL);
     1976                                       
     1977                                        imcb_add_buddy(ic, nrm, curgroup->gid == curitem->gid ? curgroup->name : NULL);
    19731978                                       
    19741979                                        if (realname) {
     
    19781983                                        }
    19791984                                }
     1985                                break;
     1986
     1987                        case 0x0001: /* Group */
     1988                                curgroup = curitem;
    19801989                                break;
    19811990
     
    24222431        char *s;
    24232432       
    2424         ccon = c->data;
     2433        if (!(ccon = c->data))
     2434                return;
    24252435               
    24262436        for (s = message; *s; s++)
     
    24632473        struct im_connection *ic = c->ic;
    24642474        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
    2465         struct chat_connection *ccon = c->data;
     2475        struct chat_connection *ccon;
     2476       
     2477        if (!(ccon = c->data))
     2478                return;
    24662479       
    24672480        aim_chat_invite(od->sess, od->conn, who, message ? message : "",
     
    24882501void oscar_chat_leave(struct groupchat *c)
    24892502{
     2503        if (!c->data)
     2504                return;
    24902505        oscar_chat_kill(c->ic, c->data);
    24912506}
    24922507
    2493 struct groupchat *oscar_chat_join(struct im_connection * ic, const char * room, const char * nick, const char * password )
     2508struct groupchat *oscar_chat_join_internal(struct im_connection *ic, const char *room,
     2509        const char *nick, const char *password, int exchange_number)
    24942510{
    24952511        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
     2512        struct groupchat *ret = imcb_chat_new(ic, room);
    24962513        aim_conn_t * cur;
    24972514
     
    24992516                int st;
    25002517               
    2501                 st = aim_chatnav_createroom(od->sess, cur, room, 4);
     2518                st = aim_chatnav_createroom(od->sess, cur, room, exchange_number);
    25022519               
    2503                 return NULL;
     2520                return ret;
    25042521        } else {
    25052522                struct create_room * cr = g_new0(struct create_room, 1);
    25062523               
    2507                 cr->exchange = 4;
     2524                cr->exchange = exchange_number;
    25082525                cr->name = g_strdup(room);
    25092526                od->create_rooms = g_slist_append(od->create_rooms, cr);
    25102527                aim_reqservice(od->sess, od->conn, AIM_CONN_TYPE_CHATNAV);
    25112528               
    2512                 return NULL;
    2513         }
     2529                return ret;
     2530        }
     2531}
     2532
     2533struct groupchat *oscar_chat_join(struct im_connection *ic, const char *room,
     2534        const char *nick, const char *password, set_t **sets)
     2535{
     2536        return oscar_chat_join_internal(ic, room, nick, password, set_getint(sets, "exchange_number"));
    25142537}
    25152538
     
    25192542        struct groupchat *ret;
    25202543        static int chat_id = 0;
    2521         char * chatname;
     2544        char * chatname, *s;
     2545        struct groupchat *c;
    25222546       
    25232547        chatname = g_strdup_printf("%s%s%d", isdigit(*ic->acc->user) ? "icq" : "",
    25242548                                   ic->acc->user, chat_id++);
    2525  
    2526         ret = oscar_chat_join(ic, chatname, NULL, NULL);
    2527 
     2549       
     2550        for (s = chatname; *s; s ++)
     2551                if (!isalnum(*s))
     2552                        *s = '0';
     2553       
     2554        c = imcb_chat_new(ic, chatname);
     2555        ret = oscar_chat_join_internal(ic, chatname, NULL, NULL, 4);
    25282556        aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0);
    25292557
     
    25372565        struct aim_chat_invitation * inv = data;
    25382566       
    2539         oscar_chat_join(inv->ic, inv->name, NULL, NULL);
     2567        oscar_chat_join_internal(inv->ic, inv->name, NULL, NULL, 4);
    25402568        g_free(inv->name);
    25412569        g_free(inv);
     
    25482576        g_free(inv->name);
    25492577        g_free(inv);
     2578}
     2579
     2580void oscar_chat_add_settings(account_t *acc, set_t **head)
     2581{
     2582        set_add(head, "exchange_number", "4", set_eval_int, NULL);
     2583}
     2584
     2585void oscar_chat_free_settings(account_t *acc, set_t **head)
     2586{
     2587        set_del(head, "exchange_number");
    25502588}
    25512589
     
    25702608        ret->chat_with = oscar_chat_with;
    25712609        ret->chat_join = oscar_chat_join;
     2610        ret->chat_add_settings = oscar_chat_add_settings;
     2611        ret->chat_free_settings = oscar_chat_free_settings;
    25722612        ret->add_permit = oscar_add_permit;
    25732613        ret->add_deny = oscar_add_deny;
Note: See TracChangeset for help on using the changeset viewer.