Ignore:
File:
1 edited

Legend:

Unmodified
Added
Removed
  • protocols/jabber/jabber.c

    r0a3c243 r75cde5d  
    471471}
    472472
    473 static gboolean jabber_callback(gpointer data, gint source, b_input_condition condition)
     473static void jabber_callback(gpointer data, gint source, GaimInputCondition condition)
    474474{
    475475        struct gaim_connection *gc = (struct gaim_connection *)data;
     
    477477
    478478        gjab_recv(jd->gjc);
    479        
    480         return TRUE;
    481479}
    482480
     
    489487}
    490488
    491 static gboolean gjab_connected(gpointer data, gint source, b_input_condition cond)
     489static void gjab_connected(gpointer data, gint source, GaimInputCondition cond)
    492490{
    493491        xmlnode x;
     
    499497        if (!g_slist_find(get_connections(), gc)) {
    500498                closesocket(source);
    501                 return FALSE;
     499                return;
    502500        }
    503501
     
    510508        if (source == -1) {
    511509                STATE_EVT(JCONN_STATE_OFF)
    512                 return FALSE;
     510                return;
    513511        }
    514512
     
    532530
    533531        gc = GJ_GC(gjc);
    534         gc->inpa = b_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc);
    535        
    536         return FALSE;
    537 }
    538 
    539 static gboolean gjab_connected_ssl(gpointer data, void *source, b_input_condition cond)
     532        gc->inpa = gaim_input_add(gjc->fd, GAIM_INPUT_READ, jabber_callback, gc);
     533}
     534
     535static void gjab_connected_ssl(gpointer data, void *source, GaimInputCondition cond)
    540536{
    541537        struct gaim_connection *gc = data;
     
    548544        if (source == NULL) {
    549545                STATE_EVT(JCONN_STATE_OFF)
    550                 return FALSE;
     546                return;
    551547        }
    552548       
    553549        if (!g_slist_find(get_connections(), gc)) {
    554550                ssl_disconnect(source);
    555                 return FALSE;
     551                return;
    556552        }
    557553       
    558         return gjab_connected(data, gjc->fd, cond);
     554        gjab_connected(data, gjc->fd, cond);
    559555}
    560556
    561557static void gjab_start(gjconn gjc)
    562558{
    563         account_t *acc;
     559        struct aim_user *user;
    564560        int port = -1, ssl = 0;
    565561        char *server = NULL, *s;
     
    568564                return;
    569565
    570         acc = GJ_GC(gjc)->acc;
    571         if (acc->server) {
     566        user = GJ_GC(gjc)->user;
     567        if (*user->proto_opt[0]) {
    572568                /* If there's a dot, assume there's a hostname in the beginning */
    573                 if (strchr(acc->server, '.')) {
    574                         server = g_strdup(acc->server);
     569                if (strchr(user->proto_opt[0], '.')) {
     570                        server = g_strdup(user->proto_opt[0]);
    575571                        if ((s = strchr(server, ':')))
    576572                                *s = 0;
     
    578574               
    579575                /* After the hostname, there can be a port number */
    580                 s = strchr(acc->server, ':');
     576                s = strchr(user->proto_opt[0], ':');
    581577                if (s && isdigit(s[1]))
    582578                        sscanf(s + 1, "%d", &port);
    583579               
    584580                /* And if there's the string ssl, the user wants an SSL-connection */
    585                 if (strstr(acc->server, ":ssl") || g_strcasecmp(acc->server, "ssl") == 0)
     581                if (strstr(user->proto_opt[0], ":ssl") || g_strcasecmp(user->proto_opt[0], "ssl") == 0)
    586582                        ssl = 1;
    587583        }
     
    616612        g_free(server);
    617613       
    618         if (!acc->gc || (gjc->fd < 0)) {
     614        if (!user->gc || (gjc->fd < 0)) {
    619615                STATE_EVT(JCONN_STATE_OFF)
    620616                return;
     
    15161512}
    15171513
    1518 static void jabber_login(account_t *acc)
    1519 {
    1520         struct gaim_connection *gc = new_gaim_conn(acc);
     1514static void jabber_login(struct aim_user *user)
     1515{
     1516        struct gaim_connection *gc = new_gaim_conn(user);
    15211517        struct jabber_data *jd = gc->proto_data = g_new0(struct jabber_data, 1);
    1522         char *loginname = create_valid_jid(acc->user, DEFAULT_SERVER, "BitlBee");
     1518        char *loginname = create_valid_jid(user->username, DEFAULT_SERVER, "BitlBee");
    15231519
    15241520        jd->hash = g_hash_table_new(g_str_hash, g_str_equal);
     
    15271523        set_login_progress(gc, 1, _("Connecting"));
    15281524
    1529         if (!(jd->gjc = gjab_new(loginname, acc->pass, gc))) {
     1525        if (!(jd->gjc = gjab_new(loginname, user->password, gc))) {
    15301526                g_free(loginname);
    15311527                hide_login_progress(gc, _("Unable to connect"));
     
    15471543}
    15481544
    1549 static gboolean jabber_free(gpointer data, gint fd, b_input_condition cond)
     1545static gboolean jabber_free(gpointer data)
    15501546{
    15511547        struct jabber_data *jd = data;
     
    15921588        }
    15931589        if (gc->inpa)
    1594                 b_event_remove(gc->inpa);
     1590                gaim_input_remove(gc->inpa);
    15951591
    15961592        if(jd) {
    1597                 b_timeout_add(50, jabber_free, jd);
     1593                g_timeout_add(50, jabber_free, jd);
    15981594                if(jd->gjc != NULL)
    15991595                        xmlnode_free(jd->gjc->current);
Note: See TracChangeset for help on using the changeset viewer.