Changeset 0da65d5 for protocols/oscar


Ignore:
Timestamp:
2007-03-31T05:40:45Z (17 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
aef4828
Parents:
fa29d093
Message:

s/gaim_connection/im_connection/ and some other minor API changes. The rest
will come tomorrow. It compiles, I'll leave the real testing up to someone
else. ;-)

Location:
protocols/oscar
Files:
4 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/aim.h

    rfa29d093 r0da65d5  
    574574
    575575struct aim_chat_invitation {
    576         struct gaim_connection * gc;
     576        struct im_connection * ic;
    577577        char * name;
    578578        guint8 exchange;
  • protocols/oscar/im.c

    rfa29d093 r0da65d5  
    14171417    guint8 *plugin;
    14181418    int i = 0, tmp = 0;
    1419     struct gaim_connection *gc = sess->aux_data;
     1419    struct im_connection *ic = sess->aux_data;
    14201420
    14211421    /* at the moment we just can deal with requests, not with cancel or accept */
     
    14691469            case 0x9c:  /* ICQ 5 seems to send this */
    14701470                aim_send_im_ch2_statusmessage(sess, userinfo->sn, args->cookie,
    1471                         gc->away ? gc->away : "", sess->aim_icq_state, dc);
     1471                        ic->away ? ic->away : "", sess->aim_icq_state, dc);
    14721472                break;
    14731473
  • protocols/oscar/oscar.c

    rfa29d093 r0da65d5  
    116116        int inpa;
    117117        int id;
    118         struct gaim_connection *gc; /* i hate this. */
    119         struct conversation *cnv; /* bah. */
     118        struct im_connection *ic; /* i hate this. */
     119        struct groupchat *cnv; /* bah. */
    120120        int maxlen;
    121121        int maxvis;
     
    123123
    124124struct ask_direct {
    125         struct gaim_connection *gc;
     125        struct im_connection *ic;
    126126        char *sn;
    127127        char ip[64];
     
    130130
    131131struct icq_auth {
    132         struct gaim_connection *gc;
     132        struct im_connection *ic;
    133133        guint32 uin;
    134134};
     
    158158}
    159159
    160 static struct chat_connection *find_oscar_chat_by_conn(struct gaim_connection *gc,
     160static struct chat_connection *find_oscar_chat_by_conn(struct im_connection *ic,
    161161                                                        aim_conn_t *conn) {
    162         GSList *g = ((struct oscar_data *)gc->proto_data)->oscar_chats;
     162        GSList *g = ((struct oscar_data *)ic->proto_data)->oscar_chats;
    163163        struct chat_connection *c = NULL;
    164164
     
    243243        aim_conn_t *conn = (aim_conn_t *)data;
    244244        aim_session_t *sess = aim_conn_getsess(conn);
    245         struct gaim_connection *gc = sess ? sess->aux_data : NULL;
     245        struct im_connection *ic = sess ? sess->aux_data : NULL;
    246246        struct oscar_data *odata;
    247247
    248         if (!gc) {
    249                 /* gc is null. we return, else we seg SIGSEG on next line. */
     248        if (!ic) {
     249                /* ic is null. we return, else we seg SIGSEG on next line. */
    250250                return FALSE;
    251251        }
    252252     
    253         if (!g_slist_find(get_connections(), gc)) {
     253        if (!g_slist_find(get_connections(), ic)) {
    254254                /* oh boy. this is probably bad. i guess the only thing we
    255255                 * can really do is return? */
     
    257257        }
    258258
    259         odata = (struct oscar_data *)gc->proto_data;
     259        odata = (struct oscar_data *)ic->proto_data;
    260260
    261261        if (condition & GAIM_INPUT_READ) {
     
    263263                        aim_rxdispatch(odata->sess);
    264264                               if (odata->killme)
    265                                        signoff(gc);
     265                                       signoff(ic);
    266266                } else {
    267267                        if ((conn->type == AIM_CONN_TYPE_BOS) ||
    268268                                   !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
    269                                 hide_login_progress_error(gc, _("Disconnected."));
    270                                 signoff(gc);
     269                                hide_login_progress_error(ic, _("Disconnected."));
     270                                signoff(ic);
    271271                        } else if (conn->type == AIM_CONN_TYPE_CHAT) {
    272                                 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn);
     272                                struct chat_connection *c = find_oscar_chat_by_conn(ic, conn);
    273273                                char buf[BUF_LONG];
    274274                                c->conn = NULL;
     
    313313static gboolean oscar_login_connect(gpointer data, gint source, b_input_condition cond)
    314314{
    315         struct gaim_connection *gc = data;
     315        struct im_connection *ic = data;
    316316        struct oscar_data *odata;
    317317        aim_session_t *sess;
    318318        aim_conn_t *conn;
    319319
    320         if (!g_slist_find(get_connections(), gc)) {
     320        if (!g_slist_find(get_connections(), ic)) {
    321321                closesocket(source);
    322322                return FALSE;
    323323        }
    324324
    325         odata = gc->proto_data;
     325        odata = ic->proto_data;
    326326        sess = odata->sess;
    327327        conn = aim_getconn_type_all(sess, AIM_CONN_TYPE_AUTH);
    328328
    329329        if (source < 0) {
    330                 hide_login_progress(gc, _("Couldn't connect to host"));
    331                 signoff(gc);
     330                hide_login_progress(ic, _("Couldn't connect to host"));
     331                signoff(ic);
    332332                return FALSE;
    333333        }
    334334
    335335        aim_conn_completeconnect(sess, conn);
    336         gc->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
     336        ic->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
    337337                        oscar_callback, conn);
    338338       
     
    340340}
    341341
    342 static void oscar_acc_init(account_t *acc)
     342static void oscar_init(account_t *acc)
    343343{
    344344        set_t *s;
     
    357357        aim_conn_t *conn;
    358358        char buf[256];
    359         struct gaim_connection *gc = new_gaim_conn(acc);
    360         struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);
     359        struct im_connection *ic = new_gaim_conn(acc);
     360        struct oscar_data *odata = ic->proto_data = g_new0(struct oscar_data, 1);
    361361
    362362        if (isdigit(acc->user[0])) {
     
    365365                   We don't do those anymore, but let's stick with it, just in case
    366366                   it accidentally fixes something else too... </bitlbee> */
    367                 gc->password[8] = 0;
     367                ic->password[8] = 0;
    368368        } else {
    369                 gc->flags |= OPT_CONN_HTML;
     369                ic->flags |= OPT_CONN_HTML;
    370370        }
    371371
     
    378378        aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
    379379        odata->sess = sess;
    380         sess->aux_data = gc;
     380        sess->aux_data = ic;
    381381
    382382        conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
    383383        if (conn == NULL) {
    384                 hide_login_progress(gc, _("Unable to login to AIM"));
    385                 signoff(gc);
     384                hide_login_progress(ic, _("Unable to login to AIM"));
     385                signoff(ic);
    386386                return;
    387387        }
    388388       
    389389        if (acc->server == NULL) {
    390                 hide_login_progress(gc, "No servername specified");
    391                 signoff(gc);
     390                hide_login_progress(ic, "No servername specified");
     391                signoff(ic);
    392392                return;
    393393        }
     
    395395        if (g_strcasecmp(acc->server, "login.icq.com") != 0 &&
    396396            g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) {
    397                 serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
    398         }
    399        
    400         g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username);
    401         set_login_progress(gc, 2, buf);
     397                serv_got_crap(ic, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server);
     398        }
     399       
     400        g_snprintf(buf, sizeof(buf), _("Signon: %s"), ic->username);
     401        set_login_progress(ic, 2, buf);
    402402
    403403        aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
     
    405405
    406406        conn->status |= AIM_CONN_STATUS_INPROGRESS;
    407         conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc);
     407        conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, ic);
    408408        if (conn->fd < 0) {
    409                 hide_login_progress(gc, _("Couldn't connect to host"));
    410                 signoff(gc);
     409                hide_login_progress(ic, _("Couldn't connect to host"));
     410                signoff(ic);
    411411                return;
    412412        }
    413         aim_request_login(sess, conn, gc->username);
    414 }
    415 
    416 static void oscar_close(struct gaim_connection *gc) {
    417         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     413        aim_request_login(sess, conn, ic->username);
     414}
     415
     416static void oscar_logout(struct im_connection *ic) {
     417        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    418418       
    419419        while (odata->oscar_chats) {
     
    438438        if (odata->oldp)
    439439                g_free(odata->oldp);
    440         if (gc->inpa > 0)
    441                 b_event_remove(gc->inpa);
     440        if (ic->inpa > 0)
     441                b_event_remove(ic->inpa);
    442442        if (odata->cnpa > 0)
    443443                b_event_remove(odata->cnpa);
     
    447447        g_free(odata->sess);
    448448        odata->sess = NULL;
    449         g_free(gc->proto_data);
    450         gc->proto_data = NULL;
     449        g_free(ic->proto_data);
     450        ic->proto_data = NULL;
    451451}
    452452
    453453static gboolean oscar_bos_connect(gpointer data, gint source, b_input_condition cond) {
    454         struct gaim_connection *gc = data;
     454        struct im_connection *ic = data;
    455455        struct oscar_data *odata;
    456456        aim_session_t *sess;
    457457        aim_conn_t *bosconn;
    458458
    459         if (!g_slist_find(get_connections(), gc)) {
     459        if (!g_slist_find(get_connections(), ic)) {
    460460                closesocket(source);
    461461                return FALSE;
    462462        }
    463463
    464         odata = gc->proto_data;
     464        odata = ic->proto_data;
    465465        sess = odata->sess;
    466466        bosconn = odata->conn;
    467467
    468468        if (source < 0) {
    469                 hide_login_progress(gc, _("Could Not Connect"));
    470                 signoff(gc);
     469                hide_login_progress(ic, _("Could Not Connect"));
     470                signoff(ic);
    471471                return FALSE;
    472472        }
    473473
    474474        aim_conn_completeconnect(sess, bosconn);
    475         gc->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
     475        ic->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
    476476                        oscar_callback, bosconn);
    477         set_login_progress(gc, 4, _("Connection established, cookie sent"));
     477        set_login_progress(ic, 4, _("Connection established, cookie sent"));
    478478       
    479479        return FALSE;
     
    486486        aim_conn_t *bosconn;
    487487
    488         struct gaim_connection *gc = sess->aux_data;
    489         struct oscar_data *od = gc->proto_data;
     488        struct im_connection *ic = sess->aux_data;
     489        struct oscar_data *od = ic->proto_data;
    490490        port = AIM_LOGIN_PORT;
    491491
     
    498498                case 0x05:
    499499                        /* Incorrect nick/password */
    500                         hide_login_progress(gc, _("Incorrect nickname or password."));
     500                        hide_login_progress(ic, _("Incorrect nickname or password."));
    501501//                      plugin_event(event_error, (void *)980, 0, 0, 0);
    502502                        break;
    503503                case 0x11:
    504504                        /* Suspended account */
    505                         hide_login_progress(gc, _("Your account is currently suspended."));
     505                        hide_login_progress(ic, _("Your account is currently suspended."));
    506506                        break;
    507507                case 0x18:
    508508                        /* connecting too frequently */
    509                         hide_login_progress(gc, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
     509                        hide_login_progress(ic, _("You have been connecting and disconnecting too frequently. Wait ten minutes and try again. If you continue to try, you will need to wait even longer."));
    510510                        break;
    511511                case 0x1c:
    512512                        /* client too old */
    513                         hide_login_progress(gc, _("The client version you are using is too old. Please upgrade at " WEBSITE));
     513                        hide_login_progress(ic, _("The client version you are using is too old. Please upgrade at " WEBSITE));
    514514                        break;
    515515                default:
    516                         hide_login_progress(gc, _("Authentication Failed"));
     516                        hide_login_progress(ic, _("Authentication Failed"));
    517517                        break;
    518518                }
     
    526526        bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, NULL);
    527527        if (bosconn == NULL) {
    528                 hide_login_progress(gc, _("Internal Error"));
     528                hide_login_progress(ic, _("Internal Error"));
    529529                od->killme = TRUE;
    530530                return 0;
     
    560560        aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_MSG, AIM_CB_MSG_MTN, gaim_parsemtn, 0);
    561561
    562         ((struct oscar_data *)gc->proto_data)->conn = bosconn;
     562        ((struct oscar_data *)ic->proto_data)->conn = bosconn;
    563563        for (i = 0; i < (int)strlen(info->bosip); i++) {
    564564                if (info->bosip[i] == ':') {
     
    569569        host = g_strndup(info->bosip, i);
    570570        bosconn->status |= AIM_CONN_STATUS_INPROGRESS;
    571         bosconn->fd = proxy_connect(host, port, oscar_bos_connect, gc);
     571        bosconn->fd = proxy_connect(host, port, oscar_bos_connect, ic);
    572572        g_free(host);
    573573        if (bosconn->fd < 0) {
    574                 hide_login_progress(gc, _("Could Not Connect"));
     574                hide_login_progress(ic, _("Could Not Connect"));
    575575                od->killme = TRUE;
    576576                return 0;
    577577        }
    578578        aim_sendcookie(sess, bosconn, info->cookie);
    579         b_event_remove(gc->inpa);
     579        b_event_remove(ic->inpa);
    580580
    581581        return 1;
     
    583583
    584584struct pieceofcrap {
    585         struct gaim_connection *gc;
     585        struct im_connection *ic;
    586586        unsigned long offset;
    587587        unsigned long len;
     
    595595{
    596596        struct pieceofcrap *pos = data;
    597         struct oscar_data *od = pos->gc->proto_data;
     597        struct oscar_data *od = pos->ic->proto_data;
    598598        char in = '\0';
    599599        int x = 0;
     
    610610        }
    611611        if (in != '\n') {
    612                 do_error_dialog(pos->gc, "Gaim was unable to get a valid hash for logging into AIM."
     612                do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
    613613                                " You may be disconnected shortly.", "Login Error");
    614614                b_event_remove(pos->inpa);
     
    633633
    634634        if (source < 0) {
    635                 do_error_dialog(pos->gc, "Gaim was unable to get a valid hash for logging into AIM."
     635                do_error_dialog(pos->ic, "Gaim was unable to get a valid hash for logging into AIM."
    636636                                " You may be disconnected shortly.", "Login Error");
    637637                if (pos->modname)
     
    699699
    700700        pos = g_new0(struct pieceofcrap, 1);
    701         pos->gc = sess->aux_data;
     701        pos->ic = sess->aux_data;
    702702        pos->conn = fr->conn;
    703703
     
    727727        char *key;
    728728        va_list ap;
    729         struct gaim_connection *gc = sess->aux_data;
     729        struct im_connection *ic = sess->aux_data;
    730730
    731731        va_start(ap, fr);
     
    733733        va_end(ap);
    734734
    735         aim_send_login(sess, fr->conn, gc->username, gc->password, &info, key);
     735        aim_send_login(sess, fr->conn, ic->username, ic->password, &info, key);
    736736
    737737        return 1;
     
    739739
    740740static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) {
    741         struct gaim_connection *gc = sess->aux_data;
     741        struct im_connection *ic = sess->aux_data;
    742742        struct chat_connection *chatcon;
    743743        static int id = 1;
     
    751751        aim_clientready(sess, fr->conn);
    752752
    753         chatcon = find_oscar_chat_by_conn(gc, fr->conn);
     753        chatcon = find_oscar_chat_by_conn(ic, fr->conn);
    754754        chatcon->id = id;
    755         chatcon->cnv = serv_got_joined_chat(gc, chatcon->show);
     755        chatcon->cnv = serv_got_joined_chat(ic, chatcon->show);
    756756        chatcon->cnv->data = chatcon;
    757757
     
    772772
    773773static gboolean oscar_chatnav_connect(gpointer data, gint source, b_input_condition cond) {
    774         struct gaim_connection *gc = data;
     774        struct im_connection *ic = data;
    775775        struct oscar_data *odata;
    776776        aim_session_t *sess;
    777777        aim_conn_t *tstconn;
    778778
    779         if (!g_slist_find(get_connections(), gc)) {
     779        if (!g_slist_find(get_connections(), ic)) {
    780780                closesocket(source);
    781781                return FALSE;
    782782        }
    783783
    784         odata = gc->proto_data;
     784        odata = ic->proto_data;
    785785        sess = odata->sess;
    786786        tstconn = aim_getconn_type_all(sess, AIM_CONN_TYPE_CHATNAV);
     
    800800static gboolean oscar_auth_connect(gpointer data, gint source, b_input_condition cond)
    801801{
    802         struct gaim_connection *gc = data;
     802        struct im_connection *ic = data;
    803803        struct oscar_data *odata;
    804804        aim_session_t *sess;
    805805        aim_conn_t *tstconn;
    806806
    807         if (!g_slist_find(get_connections(), gc)) {
     807        if (!g_slist_find(get_connections(), ic)) {
    808808                closesocket(source);
    809809                return FALSE;
    810810        }
    811811
    812         odata = gc->proto_data;
     812        odata = ic->proto_data;
    813813        sess = odata->sess;
    814814        tstconn = aim_getconn_type_all(sess, AIM_CONN_TYPE_AUTH);
     
    829829{
    830830        struct chat_connection *ccon = data;
    831         struct gaim_connection *gc = ccon->gc;
     831        struct im_connection *ic = ccon->ic;
    832832        struct oscar_data *odata;
    833833        aim_session_t *sess;
    834834        aim_conn_t *tstconn;
    835835
    836         if (!g_slist_find(get_connections(), gc)) {
     836        if (!g_slist_find(get_connections(), ic)) {
    837837                closesocket(source);
    838838                g_free(ccon->show);
     
    842842        }
    843843
    844         odata = gc->proto_data;
     844        odata = ic->proto_data;
    845845        sess = odata->sess;
    846846        tstconn = ccon->conn;
     
    867867        va_list ap;
    868868        struct aim_redirect_data *redir;
    869         struct gaim_connection *gc = sess->aux_data;
     869        struct im_connection *ic = sess->aux_data;
    870870        aim_conn_t *tstconn;
    871871        int i;
     
    899899
    900900                tstconn->status |= AIM_CONN_STATUS_INPROGRESS;
    901                 tstconn->fd = proxy_connect(host, port, oscar_auth_connect, gc);
     901                tstconn->fd = proxy_connect(host, port, oscar_auth_connect, ic);
    902902                if (tstconn->fd < 0) {
    903903                        aim_conn_kill(sess, &tstconn);
     
    916916
    917917                tstconn->status |= AIM_CONN_STATUS_INPROGRESS;
    918                 tstconn->fd = proxy_connect(host, port, oscar_chatnav_connect, gc);
     918                tstconn->fd = proxy_connect(host, port, oscar_chatnav_connect, ic);
    919919                if (tstconn->fd < 0) {
    920920                        aim_conn_kill(sess, &tstconn);
     
    938938                ccon = g_new0(struct chat_connection, 1);
    939939                ccon->conn = tstconn;
    940                 ccon->gc = gc;
     940                ccon->ic = ic;
    941941                ccon->fd = -1;
    942942                ccon->name = g_strdup(redir->chat.room);
     
    967967
    968968static int gaim_parse_oncoming(aim_session_t *sess, aim_frame_t *fr, ...) {
    969         struct gaim_connection *gc = sess->aux_data;
    970         struct oscar_data *od = gc->proto_data;
     969        struct im_connection *ic = sess->aux_data;
     970        struct oscar_data *od = ic->proto_data;
    971971        aim_userinfo_t *info;
    972972        time_t time_idle = 0, signon = 0;
     
    10181018                signon = time(NULL) - info->sessionlen;
    10191019
    1020         tmp = g_strdup(normalize(gc->username));
     1020        tmp = g_strdup(normalize(ic->username));
    10211021        if (!strcmp(tmp, normalize(info->sn)))
    1022                 g_snprintf(gc->displayname, sizeof(gc->displayname), "%s", info->sn);
     1022                g_snprintf(ic->displayname, sizeof(ic->displayname), "%s", info->sn);
    10231023        g_free(tmp);
    10241024
    1025         serv_got_update(gc, info->sn, 1, info->warnlevel/10, signon,
     1025        serv_got_update(ic, info->sn, 1, info->warnlevel/10, signon,
    10261026                        time_idle, type, caps);
    10271027
     
    10321032        aim_userinfo_t *info;
    10331033        va_list ap;
    1034         struct gaim_connection *gc = sess->aux_data;
     1034        struct im_connection *ic = sess->aux_data;
    10351035
    10361036        va_start(ap, fr);
     
    10381038        va_end(ap);
    10391039
    1040         serv_got_update(gc, info->sn, 0, 0, 0, 0, 0, 0);
     1040        serv_got_update(ic, info->sn, 0, 0, 0, 0, 0, 0);
    10411041
    10421042        return 1;
     
    10451045static int incomingim_chan1(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch1_args *args) {
    10461046        char *tmp = g_malloc(BUF_LONG + 1);
    1047         struct gaim_connection *gc = sess->aux_data;
     1047        struct im_connection *ic = sess->aux_data;
    10481048        int flags = 0;
    10491049       
     
    10831083       
    10841084        strip_linefeed(tmp);
    1085         serv_got_im(gc, userinfo->sn, tmp, flags, time(NULL), -1);
     1085        serv_got_im(ic, userinfo->sn, tmp, flags, time(NULL), -1);
    10861086        g_free(tmp);
    10871087       
     
    10931093       
    10941094static int incomingim_chan2(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch2_args *args) {
    1095         struct gaim_connection *gc = sess->aux_data;
     1095        struct im_connection *ic = sess->aux_data;
    10961096
    10971097        if (args->status != AIM_RENDEZVOUS_PROPOSE)
     
    11111111                g_snprintf( txt, 1024, "Got an invitation to chatroom %s from %s: %s", name, userinfo->sn, args->msg );
    11121112
    1113                 inv->gc = gc;
     1113                inv->ic = ic;
    11141114                inv->exchange = *exch;
    11151115                inv->name = g_strdup(name);
    11161116               
    1117                 do_ask_dialog( gc, txt, inv, oscar_accept_chat, oscar_reject_chat);
     1117                do_ask_dialog( ic, txt, inv, oscar_accept_chat, oscar_reject_chat);
    11181118       
    11191119                if (name)
     
    11261126static void gaim_icq_authgrant(gpointer w, struct icq_auth *data) {
    11271127        char *uin, message;
    1128         struct oscar_data *od = (struct oscar_data *)data->gc->proto_data;
     1128        struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
    11291129       
    11301130        uin = g_strdup_printf("%u", data->uin);
     
    11321132        aim_ssi_auth_reply(od->sess, od->conn, uin, 1, "");
    11331133        // aim_send_im_ch4(od->sess, uin, AIM_ICQMSG_AUTHGRANTED, &message);
    1134         if(find_buddy(data->gc, uin) == NULL)
    1135                 show_got_added(data->gc, uin, NULL);
     1134        if(find_buddy(data->ic, uin) == NULL)
     1135                show_got_added(data->ic, uin, NULL);
    11361136       
    11371137        g_free(uin);
     
    11411141static void gaim_icq_authdeny(gpointer w, struct icq_auth *data) {
    11421142        char *uin, *message;
    1143         struct oscar_data *od = (struct oscar_data *)data->gc->proto_data;
     1143        struct oscar_data *od = (struct oscar_data *)data->ic->proto_data;
    11441144       
    11451145        uin = g_strdup_printf("%u", data->uin);
     
    11561156 * For when other people ask you for authorization
    11571157 */
    1158 static void gaim_icq_authask(struct gaim_connection *gc, guint32 uin, char *msg) {
     1158static void gaim_icq_authask(struct im_connection *ic, guint32 uin, char *msg) {
    11591159        struct icq_auth *data = g_new(struct icq_auth, 1);
    11601160        char *reason = NULL;
     
    11651165       
    11661166        dialog_msg = g_strdup_printf("The user %u wants to add you to their buddy list for the following reason: %s", uin, reason ? reason : "No reason given.");
    1167         data->gc = gc;
     1167        data->ic = ic;
    11681168        data->uin = uin;
    1169         do_ask_dialog(gc, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);
     1169        do_ask_dialog(ic, dialog_msg, data, gaim_icq_authgrant, gaim_icq_authdeny);
    11701170        g_free(dialog_msg);
    11711171}
    11721172
    11731173static int incomingim_chan4(aim_session_t *sess, aim_conn_t *conn, aim_userinfo_t *userinfo, struct aim_incomingim_ch4_args *args) {
    1174         struct gaim_connection *gc = sess->aux_data;
     1174        struct im_connection *ic = sess->aux_data;
    11751175
    11761176        switch (args->type) {
     
    11801180                        message = g_strdup(args->msg);
    11811181                        strip_linefeed(message);
    1182                         serv_got_im(gc, uin, message, 0, time(NULL), -1);
     1182                        serv_got_im(ic, uin, message, 0, time(NULL), -1);
    11831183                        g_free(uin);
    11841184                        g_free(message);
     
    11991199
    12001200                        strip_linefeed(message);
    1201                         serv_got_im(gc, uin, message, 0, time(NULL), -1);
     1201                        serv_got_im(ic, uin, message, 0, time(NULL), -1);
    12021202                        g_free(uin);
    12031203                        g_free(m);
     
    12061206               
    12071207                case 0x0006: { /* Someone requested authorization */
    1208                         gaim_icq_authask(gc, args->uin, args->msg);
     1208                        gaim_icq_authask(ic, args->uin, args->msg);
    12091209                } break;
    12101210
     
    14181418        va_list ap;
    14191419        guint16 type;
    1420         struct gaim_connection *gc = sess->aux_data;
    1421         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     1420        struct im_connection *ic = sess->aux_data;
     1421        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    14221422
    14231423        va_start(ap, fr);
     
    14771477        int count, i;
    14781478        aim_userinfo_t *info;
    1479         struct gaim_connection *g = sess->aux_data;
     1479        struct im_connection *g = sess->aux_data;
    14801480
    14811481        struct chat_connection *c = NULL;
     
    15001500        int count, i;
    15011501        aim_userinfo_t *info;
    1502         struct gaim_connection *g = sess->aux_data;
     1502        struct im_connection *g = sess->aux_data;
    15031503
    15041504        struct chat_connection *c = NULL;
     
    15281528        guint16 unknown_c9, unknown_d2, unknown_d5, maxmsglen, maxvisiblemsglen;
    15291529        guint32 creationtime;
    1530         struct gaim_connection *gc = sess->aux_data;
    1531         struct chat_connection *ccon = find_oscar_chat_by_conn(gc, fr->conn);
     1530        struct im_connection *ic = sess->aux_data;
     1531        struct chat_connection *ccon = find_oscar_chat_by_conn(ic, fr->conn);
    15321532
    15331533        va_start(ap, fr);
     
    15551555        aim_userinfo_t *info;
    15561556        char *msg;
    1557         struct gaim_connection *gc = sess->aux_data;
    1558         struct chat_connection *ccon = find_oscar_chat_by_conn(gc, fr->conn);
     1557        struct im_connection *ic = sess->aux_data;
     1558        struct chat_connection *ccon = find_oscar_chat_by_conn(ic, fr->conn);
    15591559        char *tmp;
    15601560
     
    16171617        va_list ap;
    16181618        aim_userinfo_t *info;
    1619         struct gaim_connection *gc = sess->aux_data;
     1619        struct im_connection *ic = sess->aux_data;
    16201620
    16211621        va_start(ap, fr);
     
    16231623        va_end(ap);
    16241624
    1625         gc->evil = info->warnlevel/10;
    1626         /* gc->correction_time = (info->onlinesince - gc->login_time); */
     1625        ic->evil = info->warnlevel/10;
     1626        /* ic->correction_time = (info->onlinesince - ic->login_time); */
    16271627
    16281628        return 1;
     
    16461646
    16471647static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...) {
    1648         struct gaim_connection *gc = sess->aux_data;
    1649         struct oscar_data *od = gc->proto_data;
     1648        struct im_connection *ic = sess->aux_data;
     1649        struct oscar_data *od = ic->proto_data;
    16501650
    16511651        aim_clientready(sess, fr->conn);
     
    17041704        va_list ap;
    17051705        guint16 maxsiglen;
    1706         struct gaim_connection *gc = sess->aux_data;
    1707         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     1706        struct im_connection *ic = sess->aux_data;
     1707        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    17081708
    17091709        va_start(ap, fr);
     
    17151715        /* FIXME: It seems we're not really using this, and it broke now that
    17161716           struct aim_user is dead.
    1717         aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps);
     1717        aim_bos_setprofile(sess, fr->conn, ic->user->user_info, NULL, gaim_caps);
    17181718        */
    17191719       
     
    17241724        va_list ap;
    17251725        guint16 maxbuddies, maxwatchers;
    1726         struct gaim_connection *gc = sess->aux_data;
    1727         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     1726        struct im_connection *ic = sess->aux_data;
     1727        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    17281728
    17291729        va_start(ap, fr);
     
    17411741        guint16 maxpermits, maxdenies;
    17421742        va_list ap;
    1743         struct gaim_connection *gc = sess->aux_data;
    1744         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     1743        struct im_connection *ic = sess->aux_data;
     1744        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    17451745
    17461746        va_start(ap, fr);
     
    17651765        va_list ap;
    17661766        struct aim_icq_offlinemsg *msg;
    1767         struct gaim_connection *gc = sess->aux_data;
     1767        struct im_connection *ic = sess->aux_data;
    17681768
    17691769        va_start(ap, fr);
     
    17781778                        g_snprintf(sender, sizeof(sender), "%u", msg->sender);
    17791779                        strip_linefeed(dialog_msg);
    1780                         serv_got_im(gc, sender, dialog_msg, 0, t, -1);
     1780                        serv_got_im(ic, sender, dialog_msg, 0, t, -1);
    17811781                        g_free(dialog_msg);
    17821782                } break;
     
    17991799
    18001800                        strip_linefeed(dialog_msg);
    1801                         serv_got_im(gc, sender, dialog_msg, 0, t, -1);
     1801                        serv_got_im(ic, sender, dialog_msg, 0, t, -1);
    18021802                        g_free(dialog_msg);
    18031803                        g_free(m);
     
    18051805               
    18061806                case 0x0006: { /* Authorization request */
    1807                         gaim_icq_authask(gc, msg->sender, msg->msg);
     1807                        gaim_icq_authask(ic, msg->sender, msg->msg);
    18081808                } break;
    18091809
     
    18331833}
    18341834
    1835 static void oscar_keepalive(struct gaim_connection *gc) {
    1836         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
     1835static void oscar_keepalive(struct im_connection *ic) {
     1836        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
    18371837        aim_flap_nop(odata->sess, odata->conn);
    18381838}
    18391839
    1840 static int oscar_send_im(struct gaim_connection *gc, char *name, char *message, int len, int imflags) {
    1841         struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
    1842         int ret = 0;
     1840static int oscar_send_im(struct im_connection *ic, char *name, char *message, int imflags) {
     1841        struct oscar_data *odata = (struct oscar_data *)ic->proto_data;
     1842        int ret = 0, len = strlen(message);
    18431843        if (imflags & IM_FLAG_AWAY) {
    18441844                ret = aim_send_im(odata->sess, name, AIM_IMFLAGS_AWAY, message);
     
    18921892}
    18931893
    1894 static void oscar_get_info(struct gaim_connection *g, char *name) {
     1894static void oscar_get_info(struct im_connection *g, char *name) {
    18951895        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    18961896        if (odata->icq)
     
    19021902}
    19031903
    1904 static void oscar_get_away(struct gaim_connection *g, char *who) {
     1904static void oscar_get_away(struct im_connection *g, char *who) {
    19051905        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    19061906        if (odata->icq) {
     
    19141914}
    19151915
    1916 static void oscar_set_away_aim(struct gaim_connection *gc, struct oscar_data *od, const char *state, const char *message)
     1916static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message)
    19171917{
    19181918
     
    19261926
    19271927        if (od->rights.maxawaymsglen == 0)
    1928                 do_error_dialog(gc, "oscar_set_away_aim called before locate rights received", "Protocol Error");
     1928                do_error_dialog(ic, "oscar_set_away_aim called before locate rights received", "Protocol Error");
    19291929
    19301930        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL);
    19311931
    1932         if (gc->away)
    1933                 g_free(gc->away);
    1934         gc->away = NULL;
     1932        if (ic->away)
     1933                g_free(ic->away);
     1934        ic->away = NULL;
    19351935
    19361936        if (!message) {
     
    19441944                errstr = g_strdup_printf("Maximum away message length of %d bytes exceeded, truncating", od->rights.maxawaymsglen);
    19451945
    1946                 do_error_dialog(gc, errstr, "Away Message Too Long");
     1946                do_error_dialog(ic, errstr, "Away Message Too Long");
    19471947
    19481948                g_free(errstr);
    19491949        }
    19501950
    1951         gc->away = g_strndup(message, od->rights.maxawaymsglen);
    1952         aim_bos_setprofile(od->sess, od->conn, NULL, gc->away, gaim_caps);
     1951        ic->away = g_strndup(message, od->rights.maxawaymsglen);
     1952        aim_bos_setprofile(od->sess, od->conn, NULL, ic->away, gaim_caps);
    19531953
    19541954        return;
    19551955}
    19561956
    1957 static void oscar_set_away_icq(struct gaim_connection *gc, struct oscar_data *od, const char *state, const char *message)
     1957static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message)
    19581958{
    19591959    const char *msg = NULL;
     
    19611961
    19621962        /* clean old states */
    1963     if (gc->away) {
    1964                 g_free(gc->away);
    1965                 gc->away = NULL;
     1963    if (ic->away) {
     1964                g_free(ic->away);
     1965                ic->away = NULL;
    19661966    }
    19671967        od->sess->aim_icq_state = 0;
     
    19791979        } else if (!g_strcasecmp(state, "Away")) {
    19801980                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY);
    1981         gc->away = g_strdup(msg);
     1981        ic->away = g_strdup(msg);
    19821982                od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY;
    19831983        } else if (!g_strcasecmp(state, "Do Not Disturb")) {
    19841984                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_DND | AIM_ICQ_STATE_BUSY);
    1985         gc->away = g_strdup(msg);
     1985        ic->away = g_strdup(msg);
    19861986                od->sess->aim_icq_state = AIM_MTYPE_AUTODND;
    19871987        } else if (!g_strcasecmp(state, "Not Available")) {
    19881988                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_OUT | AIM_ICQ_STATE_AWAY);
    1989         gc->away = g_strdup(msg);
     1989        ic->away = g_strdup(msg);
    19901990                od->sess->aim_icq_state = AIM_MTYPE_AUTONA;
    19911991        } else if (!g_strcasecmp(state, "Occupied")) {
    19921992                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY | AIM_ICQ_STATE_BUSY);
    1993         gc->away = g_strdup(msg);
     1993        ic->away = g_strdup(msg);
    19941994                od->sess->aim_icq_state = AIM_MTYPE_AUTOBUSY;
    19951995        } else if (!g_strcasecmp(state, "Free For Chat")) {
    19961996                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_CHAT);
    1997         gc->away = g_strdup(msg);
     1997        ic->away = g_strdup(msg);
    19981998                od->sess->aim_icq_state = AIM_MTYPE_AUTOFFC;
    19991999        } else if (!g_strcasecmp(state, "Invisible")) {
    20002000                aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE);
    2001         gc->away = g_strdup(msg);
     2001        ic->away = g_strdup(msg);
    20022002        } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) {
    20032003                if (no_message) {
     
    20052005                } else {
    20062006                        aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY);
    2007             gc->away = g_strdup(msg);
     2007            ic->away = g_strdup(msg);
    20082008                        od->sess->aim_icq_state = AIM_MTYPE_AUTOAWAY;
    20092009                }
     
    20132013}
    20142014
    2015 static void oscar_set_away(struct gaim_connection *gc, char *state, char *message)
    2016 {
    2017         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
    2018 
    2019     oscar_set_away_aim(gc, od, state, message);
     2015static void oscar_set_away(struct im_connection *ic, char *state, char *message)
     2016{
     2017        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
     2018
     2019    oscar_set_away_aim(ic, od, state, message);
    20202020        if (od->icq)
    2021                 oscar_set_away_icq(gc, od, state, message);
     2021                oscar_set_away_icq(ic, od, state, message);
    20222022
    20232023        return;
    20242024}
    20252025
    2026 static void oscar_add_buddy(struct gaim_connection *g, char *name) {
     2026static void oscar_add_buddy(struct im_connection *g, char *name, char *group) {
    20272027        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    20282028        aim_ssi_addbuddies(odata->sess, odata->conn, OSCAR_GROUP, &name, 1, 0);
    20292029}
    20302030
    2031 static void oscar_remove_buddy(struct gaim_connection *g, char *name, char *group) {
     2031static void oscar_remove_buddy(struct im_connection *g, char *name, char *group) {
    20322032        struct oscar_data *odata = (struct oscar_data *)g->proto_data;
    20332033        struct aim_ssi_item *ssigroup;
     
    20402040
    20412041static int gaim_ssi_parselist(aim_session_t *sess, aim_frame_t *fr, ...) {
    2042         struct gaim_connection *gc = sess->aux_data;
     2042        struct im_connection *ic = sess->aux_data;
    20432043        struct aim_ssi_item *curitem;
    20442044        int tmp;
     
    20492049                switch (curitem->type) {
    20502050                        case 0x0000: /* Buddy */
    2051                                 if ((curitem->name) && (!find_buddy(gc, curitem->name))) {
     2051                                if ((curitem->name) && (!find_buddy(ic, curitem->name))) {
    20522052                                        char *realname = NULL;
    20532053
     
    20552055                                                    realname = aim_gettlv_str(curitem->data, 0x0131, 1);
    20562056                                               
    2057                                         add_buddy(gc, NULL, curitem->name, realname);
     2057                                        add_buddy(ic, NULL, curitem->name, realname);
    20582058                                       
    20592059                                        if (realname)
     
    20652065                                if (curitem->name) {
    20662066                                        GSList *list;
    2067                                         for (list=gc->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next);
     2067                                        for (list=ic->permit; (list && aim_sncmp(curitem->name, list->data)); list=list->next);
    20682068                                        if (!list) {
    20692069                                                char *name;
    20702070                                                name = g_strdup(normalize(curitem->name));
    2071                                                 gc->permit = g_slist_append(gc->permit, name);
     2071                                                ic->permit = g_slist_append(ic->permit, name);
    20722072                                                tmp++;
    20732073                                        }
     
    20782078                                if (curitem->name) {
    20792079                                        GSList *list;
    2080                                         for (list=gc->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next);
     2080                                        for (list=ic->deny; (list && aim_sncmp(curitem->name, list->data)); list=list->next);
    20812081                                        if (!list) {
    20822082                                                char *name;
    20832083                                                name = g_strdup(normalize(curitem->name));
    2084                                                 gc->deny = g_slist_append(gc->deny, name);
     2084                                                ic->deny = g_slist_append(ic->deny, name);
    20852085                                                tmp++;
    20862086                                        }
     
    20912091                                if (curitem->data) {
    20922092                                        guint8 permdeny;
    2093                                         if ((permdeny = aim_ssi_getpermdeny(sess->ssi.items)) && (permdeny != gc->permdeny)) {
    2094                                                 gc->permdeny = permdeny;
     2093                                        if ((permdeny = aim_ssi_getpermdeny(sess->ssi.items)) && (permdeny != ic->permdeny)) {
     2094                                                ic->permdeny = permdeny;
    20952095                                                tmp++;
    20962096                                        }
     
    21102110       
    21112111        /* Now that we have a buddy list, we can tell BitlBee that we're online. */
    2112         account_online(gc);
     2112        account_online(ic);
    21132113       
    21142114        return 1;
     
    21552155}
    21562156
    2157 static void oscar_set_permit_deny(struct gaim_connection *gc) {
    2158         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2157static void oscar_set_permit_deny(struct im_connection *ic) {
     2158        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    21592159        if (od->icq) {
    21602160                GSList *list;
     
    21622162                int at;
    21632163
    2164                 switch(gc->permdeny) {
     2164                switch(ic->permdeny) {
    21652165                case 1:
    2166                         aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, gc->username);
     2166                        aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_DENYADD, ic->username);
    21672167                        break;
    21682168                case 2:
    2169                         aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, gc->username);
     2169                        aim_bos_changevisibility(od->sess, od->conn, AIM_VISIBILITYCHANGE_PERMITADD, ic->username);
    21702170                        break;
    21712171                case 3:
    2172                         list = gc->permit;
     2172                        list = ic->permit;
    21732173                        at = 0;
    21742174                        while (list) {
     
    21792179                        break;
    21802180                case 4:
    2181                         list = gc->deny;
     2181                        list = ic->deny;
    21822182                        at = 0;
    21832183                        while (list) {
     
    21902190                        break;
    21912191                }
    2192                 signoff_blocked(gc);
     2192                signoff_blocked(ic);
    21932193        } else {
    21942194                if (od->sess->ssi.received_data)
    2195                         aim_ssi_setpermdeny(od->sess, od->conn, gc->permdeny, 0xffffffff);
    2196         }
    2197 }
    2198 
    2199 static void oscar_add_permit(struct gaim_connection *gc, char *who) {
    2200         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2195                        aim_ssi_setpermdeny(od->sess, od->conn, ic->permdeny, 0xffffffff);
     2196        }
     2197}
     2198
     2199static void oscar_add_permit(struct im_connection *ic, char *who) {
     2200        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    22012201        if (od->icq) {
    22022202                aim_ssi_auth_reply(od->sess, od->conn, who, 1, "");
     
    22072207}
    22082208
    2209 static void oscar_add_deny(struct gaim_connection *gc, char *who) {
    2210         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2209static void oscar_add_deny(struct im_connection *ic, char *who) {
     2210        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    22112211        if (od->icq) {
    22122212                aim_ssi_auth_reply(od->sess, od->conn, who, 0, "");
     
    22172217}
    22182218
    2219 static void oscar_rem_permit(struct gaim_connection *gc, char *who) {
    2220         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2219static void oscar_rem_permit(struct im_connection *ic, char *who) {
     2220        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    22212221        if (!od->icq) {
    22222222                if (od->sess->ssi.received_data)
     
    22252225}
    22262226
    2227 static void oscar_rem_deny(struct gaim_connection *gc, char *who) {
    2228         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2227static void oscar_rem_deny(struct im_connection *ic, char *who) {
     2228        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    22292229        if (!od->icq) {
    22302230                if (od->sess->ssi.received_data)
     
    22332233}
    22342234
    2235 static GList *oscar_away_states(struct gaim_connection *gc)
    2236 {
    2237         struct oscar_data *od = gc->proto_data;
     2235static GList *oscar_away_states(struct im_connection *ic)
     2236{
     2237        struct oscar_data *od = ic->proto_data;
    22382238        GList *m = NULL;
    22392239
     
    22542254static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...)
    22552255{
    2256         struct gaim_connection *gc = sess->aux_data;
     2256        struct im_connection *ic = sess->aux_data;
    22572257        gchar who[16];
    22582258        GString *str;
     
    23302330        }
    23312331
    2332                 serv_got_crap(gc, "%s\n%s", _("User Info"), str->str);
     2332                serv_got_crap(ic, "%s\n%s", _("User Info"), str->str);
    23332333        g_string_free(str, TRUE);
    23342334
     
    23952395static int gaim_parseaiminfo(aim_session_t *sess, aim_frame_t *fr, ...)
    23962396{
    2397         struct gaim_connection *gc = sess->aux_data;
     2397        struct im_connection *ic = sess->aux_data;
    23982398        va_list ap;
    23992399        aim_userinfo_t *userinfo;
     
    24242424                        idletime.tm_sec = 0;
    24252425                        strftime(buff, 256, _("%d days %H hours %M minutes"), &idletime);
    2426                         serv_got_crap(gc, "%s: %s", _("Idle Time"), buff);
     2426                        serv_got_crap(ic, "%s: %s", _("Idle Time"), buff);
    24272427                }
    24282428               
    24292429                if(text) {
    24302430                        utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
    2431                         serv_got_crap(gc, "%s\n%s", _("User Info"), utf8);
     2431                        serv_got_crap(ic, "%s\n%s", _("User Info"), utf8);
    24322432                } else {
    2433                         serv_got_crap(gc, _("No user info available."));
     2433                        serv_got_crap(ic, _("No user info available."));
    24342434                }
    24352435        } else if(infotype == AIM_GETINFO_AWAYMESSAGE && userinfo->flags & AIM_FLAG_AWAY) {
    24362436                utf8 = oscar_encoding_to_utf8(extracted_encoding, text, text_length);
    2437                 serv_got_crap(gc, "%s\n%s", _("Away Message"), utf8);
     2437                serv_got_crap(ic, "%s\n%s", _("Away Message"), utf8);
    24382438        }
    24392439
     
    24452445int gaim_parsemtn(aim_session_t *sess, aim_frame_t *fr, ...)
    24462446{
    2447         struct gaim_connection * gc = sess->aux_data;
     2447        struct im_connection * ic = sess->aux_data;
    24482448        va_list ap;
    24492449        guint16 type1, type2;
     
    24582458        if(type2 == 0x0002) {
    24592459                /* User is typing */
    2460                 serv_got_typing(gc, sn, 0, 1);
     2460                serv_got_typing(ic, sn, 0, 1);
    24612461        }
    24622462        else if (type2 == 0x0001) {
    24632463                /* User has typed something, but is not actively typing (stale) */
    2464                 serv_got_typing(gc, sn, 0, 2);
     2464                serv_got_typing(ic, sn, 0, 2);
    24652465        }
    24662466        else {
    24672467                /* User has stopped typing */
    2468                 serv_got_typing(gc, sn, 0, 0);
     2468                serv_got_typing(ic, sn, 0, 0);
    24692469        }       
    24702470       
     
    24722472}
    24732473
    2474 static char *oscar_get_status_string( struct gaim_connection *gc, int number )
    2475 {
    2476         struct oscar_data *od = gc->proto_data;
     2474static char *oscar_get_status_string( struct im_connection *ic, int number )
     2475{
     2476        struct oscar_data *od = ic->proto_data;
    24772477       
    24782478        if( ! number & UC_UNAVAILABLE )
     
    25002500}
    25012501
    2502 int oscar_send_typing(struct gaim_connection *gc, char * who, int typing)
    2503 {
    2504         struct oscar_data *od = gc->proto_data;
     2502int oscar_send_typing(struct im_connection *ic, char * who, int typing)
     2503{
     2504        struct oscar_data *od = ic->proto_data;
    25052505        return( aim_im_sendmtn(od->sess, 1, who, typing ? 0x0002 : 0x0000) );
    25062506}
    25072507
    2508 int oscar_chat_send(struct conversation *c, char *message)
    2509 {
    2510         struct gaim_connection *gc = c->gc;
    2511         struct oscar_data * od = (struct oscar_data*)gc->proto_data;
     2508void oscar_chat_send(struct groupchat *c, char *message, int msgflags)
     2509{
     2510        struct im_connection *ic = c->ic;
     2511        struct oscar_data * od = (struct oscar_data*)ic->proto_data;
    25122512        struct chat_connection * ccon;
    25132513        int ret;
     
    25502550  }
    25512551 
    2552   return (ret >= 0);
    2553 }
    2554 
    2555 void oscar_chat_invite(struct conversation *c, char *message, char *who)
    2556 {
    2557         struct gaim_connection *gc = c->gc;
    2558         struct oscar_data * od = (struct oscar_data *)gc->proto_data;
     2552/*  return (ret >= 0); */
     2553}
     2554
     2555void oscar_chat_invite(struct groupchat *c, char *message, char *who)
     2556{
     2557        struct im_connection *ic = c->ic;
     2558        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
    25592559        struct chat_connection *ccon = c->data;
    25602560       
     
    25632563}
    25642564
    2565 void oscar_chat_kill(struct gaim_connection *gc, struct chat_connection *cc)
    2566 {
    2567         struct oscar_data *od = (struct oscar_data *)gc->proto_data;
     2565void oscar_chat_kill(struct im_connection *ic, struct chat_connection *cc)
     2566{
     2567        struct oscar_data *od = (struct oscar_data *)ic->proto_data;
    25682568
    25692569        /* Notify the conversation window that we've left the chat */
     
    25802580}
    25812581
    2582 void oscar_chat_leave(struct conversation *c)
    2583 {
    2584         oscar_chat_kill(c->gc, c->data);
    2585 }
    2586 
    2587 int oscar_chat_join(struct gaim_connection * gc, char * name)
    2588 {
    2589         struct oscar_data * od = (struct oscar_data *)gc->proto_data;
     2582void oscar_chat_leave(struct groupchat *c)
     2583{
     2584        oscar_chat_kill(c->ic, c->data);
     2585}
     2586
     2587int oscar_chat_join(struct im_connection * ic, char * name)
     2588{
     2589        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
    25902590       
    25912591        aim_conn_t * cur;
     
    26052605}
    26062606
    2607 struct conversation *oscar_chat_open(struct gaim_connection * gc, char *who)
    2608 {
    2609         struct oscar_data * od = (struct oscar_data *)gc->proto_data;
     2607struct groupchat *oscar_chat_with(struct im_connection * ic, char *who)
     2608{
     2609        struct oscar_data * od = (struct oscar_data *)ic->proto_data;
    26102610        int ret;
    26112611        static int chat_id = 0;
    26122612        char * chatname;
    26132613       
    2614         chatname = g_strdup_printf("%s%d", gc->username, chat_id++);
     2614        chatname = g_strdup_printf("%s%d", ic->username, chat_id++);
    26152615 
    2616         ret = oscar_chat_join(gc, chatname);
     2616        ret = oscar_chat_join(ic, chatname);
    26172617
    26182618        aim_chat_invite(od->sess, od->conn, who, "", 4, chatname, 0x0);
     
    26252625void oscar_accept_chat(gpointer w, struct aim_chat_invitation * inv)
    26262626{
    2627         oscar_chat_join(inv->gc, inv->name);
     2627        oscar_chat_join(inv->ic, inv->name);
    26282628        g_free(inv->name);
    26292629        g_free(inv);
     
    26362636}
    26372637
    2638 void oscar_init()
     2638void oscar_initmodule()
    26392639{
    26402640        struct prpl *ret = g_new0(struct prpl, 1);
    26412641        ret->name = "oscar";
    26422642        ret->away_states = oscar_away_states;
     2643        ret->init = oscar_init;
    26432644        ret->login = oscar_login;
    2644         ret->acc_init = oscar_acc_init;
    2645         ret->close = oscar_close;
     2645        ret->keepalive = oscar_keepalive;
     2646        ret->logout = oscar_logout;
    26462647        ret->send_im = oscar_send_im;
    26472648        ret->get_info = oscar_get_info;
     
    26532654        ret->chat_invite = oscar_chat_invite;
    26542655        ret->chat_leave = oscar_chat_leave;
    2655         ret->chat_open = oscar_chat_open;
     2656        ret->chat_with = oscar_chat_with;
    26562657        ret->add_permit = oscar_add_permit;
    26572658        ret->add_deny = oscar_add_deny;
     
    26592660        ret->rem_deny = oscar_rem_deny;
    26602661        ret->set_permit_deny = oscar_set_permit_deny;
    2661         ret->keepalive = oscar_keepalive;
    26622662        ret->get_status_string = oscar_get_status_string;
    26632663        ret->send_typing = oscar_send_typing;
  • protocols/oscar/service.c

    rfa29d093 r0da65d5  
    732732        guint32 data;
    733733        int tlvlen;
    734         struct gaim_connection *gc = sess ? sess->aux_data : NULL;
     734        struct im_connection *ic = sess ? sess->aux_data : NULL;
    735735
    736736        data = AIM_ICQ_STATE_HIDEIP | status; /* yay for error checking ;^) */
    737737       
    738         if (gc && set_getbool(&gc->acc->set, "web_aware"))
     738        if (ic && set_getbool(&ic->acc->set, "web_aware"))
    739739                data |= AIM_ICQ_STATE_WEBAWARE;
    740740
Note: See TracChangeset for help on using the changeset viewer.