Changeset ba9edaa for protocols/oscar


Ignore:
Timestamp:
2006-05-10T17:34:46Z (18 years ago)
Author:
Wilmer van der Gaast <wilmer@…>
Branches:
master
Children:
13cc96c
Parents:
67b6766
Message:

Moved everything to the BitlBee event handling API.

File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/oscar/oscar.c

    r67b6766 rba9edaa  
    253253static int msgerrreasonlen = 25;
    254254
    255 static void oscar_callback(gpointer data, gint source,
    256                                 GaimInputCondition condition) {
     255static gboolean oscar_callback(gpointer data, gint source,
     256                                b_input_condition condition) {
    257257        aim_conn_t *conn = (aim_conn_t *)data;
    258258        aim_session_t *sess = aim_conn_getsess(conn);
     
    262262        if (!gc) {
    263263                /* gc is null. we return, else we seg SIGSEG on next line. */
    264                 return;
     264                return FALSE;
    265265        }
    266266     
     
    268268                /* oh boy. this is probably bad. i guess the only thing we
    269269                 * can really do is return? */
    270                 return;
     270                return FALSE;
    271271        }
    272272
     
    288288                                c->conn = NULL;
    289289                                if (c->inpa > 0)
    290                                         gaim_input_remove(c->inpa);
     290                                        b_event_remove(c->inpa);
    291291                                c->inpa = 0;
    292292                                c->fd = -1;
     
    296296                        } else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
    297297                                if (odata->cnpa > 0)
    298                                         gaim_input_remove(odata->cnpa);
     298                                        b_event_remove(odata->cnpa);
    299299                                odata->cnpa = 0;
    300300                                while (odata->create_rooms) {
     
    310310                        } else if (conn->type == AIM_CONN_TYPE_AUTH) {
    311311                                if (odata->paspa > 0)
    312                                         gaim_input_remove(odata->paspa);
     312                                        b_event_remove(odata->paspa);
    313313                                odata->paspa = 0;
    314314                                aim_conn_kill(odata->sess, &conn);
     
    317317                        }
    318318                }
    319         }
    320 }
    321 
    322 static void oscar_login_connect(gpointer data, gint source, GaimInputCondition cond)
     319        } else {
     320                /* WTF??? */
     321                return FALSE;
     322        }
     323               
     324        return TRUE;
     325}
     326
     327static gboolean oscar_login_connect(gpointer data, gint source, b_input_condition cond)
    323328{
    324329        struct gaim_connection *gc = data;
     
    329334        if (!g_slist_find(get_connections(), gc)) {
    330335                closesocket(source);
    331                 return;
     336                return FALSE;
    332337        }
    333338
     
    339344                hide_login_progress(gc, _("Couldn't connect to host"));
    340345                signoff(gc);
    341                 return;
     346                return FALSE;
    342347        }
    343348
    344349        aim_conn_completeconnect(sess, conn);
    345         gc->inpa = gaim_input_add(conn->fd, GAIM_INPUT_READ,
     350        gc->inpa = b_input_add(conn->fd, GAIM_INPUT_READ,
    346351                        oscar_callback, conn);
     352       
     353        return FALSE;
    347354}
    348355
     
    412419                struct chat_connection *n = odata->oscar_chats->data;
    413420                if (n->inpa > 0)
    414                         gaim_input_remove(n->inpa);
     421                        b_event_remove(n->inpa);
    415422                g_free(n->name);
    416423                g_free(n->show);
     
    431438                g_free(odata->oldp);
    432439        if (gc->inpa > 0)
    433                 gaim_input_remove(gc->inpa);
     440                b_event_remove(gc->inpa);
    434441        if (odata->cnpa > 0)
    435                 gaim_input_remove(odata->cnpa);
     442                b_event_remove(odata->cnpa);
    436443        if (odata->paspa > 0)
    437                 gaim_input_remove(odata->paspa);
     444                b_event_remove(odata->paspa);
    438445        aim_session_kill(odata->sess);
    439446        g_free(odata->sess);
     
    443450}
    444451
    445 static void oscar_bos_connect(gpointer data, gint source, GaimInputCondition cond) {
     452static gboolean oscar_bos_connect(gpointer data, gint source, b_input_condition cond) {
    446453        struct gaim_connection *gc = data;
    447454        struct oscar_data *odata;
     
    451458        if (!g_slist_find(get_connections(), gc)) {
    452459                closesocket(source);
    453                 return;
     460                return FALSE;
    454461        }
    455462
     
    461468                hide_login_progress(gc, _("Could Not Connect"));
    462469                signoff(gc);
    463                 return;
     470                return FALSE;
    464471        }
    465472
    466473        aim_conn_completeconnect(sess, bosconn);
    467         gc->inpa = gaim_input_add(bosconn->fd, GAIM_INPUT_READ,
     474        gc->inpa = b_input_add(bosconn->fd, GAIM_INPUT_READ,
    468475                        oscar_callback, bosconn);
    469476        set_login_progress(gc, 4, _("Connection established, cookie sent"));
     477       
     478        return FALSE;
    470479}
    471480
     
    570579        }
    571580        aim_sendcookie(sess, bosconn, info->cookie);
    572         gaim_input_remove(gc->inpa);
     581        b_event_remove(gc->inpa);
    573582
    574583        return 1;
     
    585594};
    586595
    587 static void damn_you(gpointer data, gint source, GaimInputCondition c)
     596static gboolean damn_you(gpointer data, gint source, b_input_condition c)
    588597{
    589598        struct pieceofcrap *pos = data;
     
    605614                do_error_dialog(pos->gc, "Gaim was unable to get a valid hash for logging into AIM."
    606615                                " You may be disconnected shortly.", "Login Error");
    607                 gaim_input_remove(pos->inpa);
     616                b_event_remove(pos->inpa);
    608617                closesocket(pos->fd);
    609618                g_free(pos);
    610                 return;
     619                return FALSE;
    611620        }
    612621        /* [WvG] Wheeeee! Who needs error checking anyway? ;-) */
    613622        read(pos->fd, m, 16);
    614623        m[16] = '\0';
    615         gaim_input_remove(pos->inpa);
     624        b_event_remove(pos->inpa);
    616625        closesocket(pos->fd);
    617626        aim_sendmemblock(od->sess, pos->conn, 0, 16, m, AIM_SENDMEMBLOCK_FLAG_ISHASH);
    618627        g_free(pos);
    619 }
    620 
    621 static void straight_to_hell(gpointer data, gint source, GaimInputCondition cond) {
     628       
     629        return FALSE;
     630}
     631
     632static gboolean straight_to_hell(gpointer data, gint source, b_input_condition cond) {
    622633        struct pieceofcrap *pos = data;
    623634        char buf[BUF_LONG];
     
    629640                        g_free(pos->modname);
    630641                g_free(pos);
    631                 return;
     642                return FALSE;
    632643        }
    633644
     
    638649        if (pos->modname)
    639650                g_free(pos->modname);
    640         pos->inpa = gaim_input_add(pos->fd, GAIM_INPUT_READ, damn_you, pos);
    641         return;
     651        pos->inpa = b_input_add(pos->fd, GAIM_INPUT_READ, damn_you, pos);
     652        return FALSE;
    642653}
    643654
     
    761772}
    762773
    763 static void oscar_chatnav_connect(gpointer data, gint source, GaimInputCondition cond) {
     774static gboolean oscar_chatnav_connect(gpointer data, gint source, b_input_condition cond) {
    764775        struct gaim_connection *gc = data;
    765776        struct oscar_data *odata;
     
    769780        if (!g_slist_find(get_connections(), gc)) {
    770781                closesocket(source);
    771                 return;
     782                return FALSE;
    772783        }
    773784
     
    778789        if (source < 0) {
    779790                aim_conn_kill(sess, &tstconn);
    780                 return;
     791                return FALSE;
    781792        }
    782793
    783794        aim_conn_completeconnect(sess, tstconn);
    784         odata->cnpa = gaim_input_add(tstconn->fd, GAIM_INPUT_READ,
     795        odata->cnpa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
    785796                                        oscar_callback, tstconn);
    786 }
    787 
    788 static void oscar_auth_connect(gpointer data, gint source, GaimInputCondition cond)
     797       
     798        return FALSE;
     799}
     800
     801static gboolean oscar_auth_connect(gpointer data, gint source, b_input_condition cond)
    789802{
    790803        struct gaim_connection *gc = data;
     
    795808        if (!g_slist_find(get_connections(), gc)) {
    796809                closesocket(source);
    797                 return;
     810                return FALSE;
    798811        }
    799812
     
    804817        if (source < 0) {
    805818                aim_conn_kill(sess, &tstconn);
    806                 return;
     819                return FALSE;
    807820        }
    808821
    809822        aim_conn_completeconnect(sess, tstconn);
    810         odata->paspa = gaim_input_add(tstconn->fd, GAIM_INPUT_READ,
     823        odata->paspa = b_input_add(tstconn->fd, GAIM_INPUT_READ,
    811824                                oscar_callback, tstconn);
    812 }
    813 
    814 static void oscar_chat_connect(gpointer data, gint source, GaimInputCondition cond)
     825       
     826        return FALSE;
     827}
     828
     829static gboolean oscar_chat_connect(gpointer data, gint source, b_input_condition cond)
    815830{
    816831        struct chat_connection *ccon = data;
     
    825840                g_free(ccon->name);
    826841                g_free(ccon);
    827                 return;
     842                return FALSE;
    828843        }
    829844
     
    837852                g_free(ccon->name);
    838853                g_free(ccon);
    839                 return;
     854                return FALSE;
    840855        }
    841856
    842857        aim_conn_completeconnect(sess, ccon->conn);
    843         ccon->inpa = gaim_input_add(tstconn->fd,
     858        ccon->inpa = b_input_add(tstconn->fd,
    844859                        GAIM_INPUT_READ,
    845860                        oscar_callback, tstconn);
    846861        odata->oscar_chats = g_slist_append(odata->oscar_chats, ccon);
     862       
     863        return FALSE;
    847864}
    848865
     
    25582575        od->oscar_chats = g_slist_remove(od->oscar_chats, cc);
    25592576        if (cc->inpa > 0)
    2560                 gaim_input_remove(cc->inpa);
     2577                b_event_remove(cc->inpa);
    25612578        aim_conn_kill(od->sess, &cc->conn);
    25622579        g_free(cc->name);
Note: See TracChangeset for help on using the changeset viewer.