Changeset a0a5179 for aim.c


Ignore:
Timestamp:
Nov 19, 2003, 11:19:03 PM (20 years ago)
Author:
James M. Kretchmar <kretch@mit.edu>
Branches:
master, barnowl_perlaim, debian, owl, release-1.10, release-1.4, release-1.5, release-1.6, release-1.7, release-1.8, release-1.9
Children:
f1645da
Parents:
52f3507
Message:
blist works for AIM even if the zephyr .anyone can't be read
AIM Buddy debugging
File:
1 edited

Legend:

Unmodified
Added
Removed
  • aim.c

    r1db061d ra0a5179  
    116116
    117117  /* an experiment to expose idle time */
    118   aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400);
     118  /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */
    119119}
    120120
     
    136136  aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL);
    137137 
    138   /* login */
     138  /* request a login */
    139139  ret=login(owl_global_get_aimsess(&g), priv->screenname, priv->password);
    140140  if (ret) {
     
    143143    return(-1);
    144144  }
     145
     146  /* start processing AIM events */
    145147  owl_global_set_doaimevents(&g);
    146148
    147149  return(0);
    148150}
    149 
    150 #if 0
    151 static void oscar_login(GaimAccount *account)
    152 {
    153   aim_session_t *sess;
    154   aim_conn_t *conn;
    155   char buf[256];
    156   GaimConnection *gc = gaim_account_get_connection(account);
    157   struct oscar_data *od = gc->proto_data = g_new0(struct oscar_data, 1);
    158 
    159   gaim_debug(GAIM_DEBUG_MISC, "oscar", "oscar_login: gc = %p\n", gc);
    160 
    161   if (isdigit(*(gaim_account_get_username(account)))) {
    162     od->icq = TRUE;
    163   } else {
    164     gc->flags |= GAIM_CONNECTION_HTML;
    165     gc->flags |= GAIM_CONNECTION_AUTO_RESP;
    166   }
    167   od->buddyinfo = g_hash_table_new_full(g_str_hash, g_str_equal, g_free, oscar_free_buddyinfo);
    168 
    169   sess = g_new0(aim_session_t, 1);
    170 
    171   aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT, 0);
    172   aim_setdebuggingcb(sess, oscar_debug);
    173 
    174   /* we need an immediate queue because we don't use a while-loop to
    175    * see if things need to be sent. */
    176   aim_tx_setenqueue(sess, AIM_TX_IMMEDIATE, NULL);
    177   od->sess = sess;
    178   sess->aux_data = gc;
    179 
    180   conn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, NULL);
    181   if (conn == NULL) {
    182     gaim_debug(GAIM_DEBUG_ERROR, "oscar",
    183                "internal connection error\n");
    184     gaim_connection_error(gc, _("Unable to login to AIM"));
    185     return;
    186   }
    187 
    188   g_snprintf(buf, sizeof(buf), _("Signon: %s"), gaim_account_get_username(account));
    189   gaim_connection_update_progress(gc, buf, 2, 5);
    190 
    191   aim_conn_addhandler(sess, conn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_connerr, 0);
    192   aim_conn_addhandler(sess, conn, 0x0017, 0x0007, gaim_parse_login, 0);
    193   aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0);
    194 
    195   conn->status |= AIM_CONN_STATUS_INPROGRESS;
    196   if (gaim_proxy_connect(account, gaim_account_get_string(account, "server", FAIM_LOGIN_SERVER),
    197                          gaim_account_get_int(account, "port", FAIM_LOGIN_PORT),
    198                          oscar_login_connect, gc) < 0) {
    199     gaim_connection_error(gc, _("Couldn't connect to host"));
    200     return;
    201   }
    202   aim_request_login(sess, conn, gaim_account_get_username(account));
    203 }
    204 #endif
    205 
    206151
    207152/* stuff to run once login has been successful */
     
    269214void owl_aim_addbuddy(char *name)
    270215{
     216
    271217  aim_ssi_addbuddy(owl_global_get_aimsess(&g), name, "Buddies", NULL, NULL, NULL, 0);
     218
     219  /*
     220  aim_ssi_addbuddy(owl_global_get_aimsess(&g),
     221                   name,
     222                   "Buddies",
     223                   NULL, NULL, NULL,
     224                   aim_ssi_waitingforauth(owl_global_get_aimsess(&g)->ssi.local, "Buddies", name));
     225  */
    272226}
    273227
     
    566520  aim_bos_reqrights(sess, fr->conn); /* XXX - Don't call this with ssi? */
    567521
    568   /* aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_CHAT); */
     522  /* aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_EMPTY); */
    569523
    570524#ifdef NOSSI
     
    588542
    589543  if (!priv->screenname || !priv->password) {
    590     /* printf("need SN and password\n"); */
     544    owl_function_error("Internal error: aim login called without screenname or password");
    591545    return(-1);
    592546  }
    593547
    594548  if (!(authconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, priv->server ? priv->server : FAIM_LOGIN_SERVER))) {
    595     /* printf("internal connection error during login\n"); */
     549    owl_function_error("Internal error: connection error during AIM login\n");
    596550    return (-1);
    597551  } else if (authconn->fd == -1) {
    598552    if (authconn->status & AIM_CONN_STATUS_RESOLVERR) {
    599       /* printf("could not resolve authorizer name\n");*/
     553      owl_function_error("AIM: could not resolve authorize name");
    600554    } else if (authconn->status & AIM_CONN_STATUS_CONNERR) {
    601       /* printf("could not connect to authorizer\n"); */
     555      owl_function_error("AIM: could not connect to authorizer");
    602556    }
    603557    aim_conn_kill(sess, &authconn);
     
    612566  /* If the connection is in progress, this will just be queued */
    613567  aim_request_login(sess, authconn, priv->screenname);
    614 
    615   /* printf("login request sent\n"); */
     568  owl_function_debugmsg("AIM login request sent for %s", priv->screenname);
     569
    616570  return(0);
    617571}
     
    621575{
    622576  aim_clientready(sess, fr->conn);
    623   /* printf("initialization done for admin connection\n"); */
     577  owl_function_debugmsg("conninitdone_admin: initializtion done for admin connection");
    624578  return(1);
    625579}
     
    629583  aim_session_kill(sess);
    630584  owl_aim_init();
    631  
    632   /* kretch
     585
     586  owl_function_debugmsg("libfaim logout called");
     587  /*
    633588  if (faimtest_init() == -1)
    634589    printf("faimtest_init failed\n");
     
    770725 
    771726  /* printf("buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); */
     727  owl_function_debugmsg("in faimtest_parse_buddyrights");
    772728 
    773729  /* aim_ssi_reqrights(sess, fr->conn); */
     
    802758  maxsiglen = va_arg(ap, int);
    803759  va_end(ap);
     760
     761  owl_function_debugmsg("in faimtest_parse_locrights");
    804762
    805763  /* printf("locate rights: max signature length = %d\n", maxsiglen); */
Note: See TracChangeset for help on using the changeset viewer.