- Timestamp:
- Nov 19, 2003, 11:19:03 PM (20 years ago)
- 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
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
r1db061d ra0a5179 116 116 117 117 /* 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); */ 119 119 } 120 120 … … 136 136 aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL); 137 137 138 /* login */138 /* request a login */ 139 139 ret=login(owl_global_get_aimsess(&g), priv->screenname, priv->password); 140 140 if (ret) { … … 143 143 return(-1); 144 144 } 145 146 /* start processing AIM events */ 145 147 owl_global_set_doaimevents(&g); 146 148 147 149 return(0); 148 150 } 149 150 #if 0151 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 to175 * 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 #endif205 206 151 207 152 /* stuff to run once login has been successful */ … … 269 214 void owl_aim_addbuddy(char *name) 270 215 { 216 271 217 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 */ 272 226 } 273 227 … … 566 520 aim_bos_reqrights(sess, fr->conn); /* XXX - Don't call this with ssi? */ 567 521 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); */ 569 523 570 524 #ifdef NOSSI … … 588 542 589 543 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"); 591 545 return(-1); 592 546 } 593 547 594 548 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"); 596 550 return (-1); 597 551 } else if (authconn->fd == -1) { 598 552 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"); 600 554 } 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"); 602 556 } 603 557 aim_conn_kill(sess, &authconn); … … 612 566 /* If the connection is in progress, this will just be queued */ 613 567 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 616 570 return(0); 617 571 } … … 621 575 { 622 576 aim_clientready(sess, fr->conn); 623 /* printf("initialization done for admin connection\n"); */577 owl_function_debugmsg("conninitdone_admin: initializtion done for admin connection"); 624 578 return(1); 625 579 } … … 629 583 aim_session_kill(sess); 630 584 owl_aim_init(); 631 632 /* kretch 585 586 owl_function_debugmsg("libfaim logout called"); 587 /* 633 588 if (faimtest_init() == -1) 634 589 printf("faimtest_init failed\n"); … … 770 725 771 726 /* printf("buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); */ 727 owl_function_debugmsg("in faimtest_parse_buddyrights"); 772 728 773 729 /* aim_ssi_reqrights(sess, fr->conn); */ … … 802 758 maxsiglen = va_arg(ap, int); 803 759 va_end(ap); 760 761 owl_function_debugmsg("in faimtest_parse_locrights"); 804 762 805 763 /* printf("locate rights: max signature length = %d\n", maxsiglen); */
Note: See TracChangeset
for help on using the changeset viewer.