- Timestamp:
- Oct 25, 2003, 11:00:13 PM (22 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:
- 37eab7f
- Parents:
- db2dd3d
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
ra836200 r8c92848 149 149 150 150 #if 0 151 static void oscar_login(GaimAccount *account) { 151 static void oscar_login(GaimAccount *account) 152 { 152 153 aim_session_t *sess; 153 154 aim_conn_t *conn; … … 207 208 void owl_aim_successful_login(char *screenname) 208 209 { 210 owl_function_debugmsg("doing owl_aim_successful_login"); 209 211 owl_global_set_aimloggedin(&g, screenname); 210 212 owl_global_set_doaimevents(&g); /* this should already be on */ … … 218 220 219 221 /* aim_bos_setidle(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), 5000); */ 222 /* aim_bos_setprofile(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_CHAT); */ 220 223 } 221 224 … … 281 284 } 282 285 283 void owl_aim_chat_join(char *chatroom) 284 { 286 void owl_aim_chat_join(char *chatroom, int exchange) 287 { 288 int ret; 289 290 /* ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); */ 291 /* 292 ret=aim_chat_join(owl_global_get_aimsess(&g), 293 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), exchange, chatroom, 0x0000); 294 */ 295 296 aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV); 297 ret = aim_chatnav_createroom(owl_global_get_aimsess(&g), 298 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), chatroom, exchange); 299 ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); 300 301 owl_function_debugmsg("Attempting to join chatroom %s exchange %i", chatroom, exchange); 285 302 } 286 303 … … 295 312 296 313 /* caller must free the return */ 297 char *owl_aim_normalize_screenname(char *in) { 314 char *owl_aim_normalize_screenname(char *in) 315 { 298 316 char *out; 299 317 int i, j, k; … … 312 330 } 313 331 314 int owl_aim_process_events() { 332 int owl_aim_process_events() 333 { 315 334 aim_session_t *aimsess; 316 335 aim_conn_t *waitingconn = NULL; … … 334 353 if (selstat == -1) { 335 354 owl_aim_logged_out(); 336 } else if (selstat == 0) { 355 } else if (selstat == 0) { 337 356 /* no events pending */ 338 357 } else if (selstat == 1) { /* outgoing data pending */ … … 350 369 /* printf("disconnected from %s\n", aim_directim_getsn(waitingconn)); */ 351 370 aim_conn_kill(aimsess, &waitingconn); 371 owl_aim_logged_out(); 352 372 } 353 373 } else { 354 374 aim_conn_kill(aimsess, &waitingconn); 375 owl_aim_logged_out(); 355 376 } 356 377 if (!aim_getconn_type(aimsess, AIM_CONN_TYPE_BOS)) { 357 378 /* printf("major connection error\n"); */ 379 owl_aim_logged_out(); 358 380 /* break; */ 359 /* we should probably kill the session */360 381 } 361 382 } … … 383 404 va_end(ap); 384 405 406 owl_function_debugmsg("doing faimtest_parse_login"); 407 385 408 aim_send_login(sess, fr->conn, priv->screenname, priv->password, &info, key); 386 409 387 return 1;410 return(1); 388 411 } 389 412 … … 400 423 401 424 /* printf("Screen name: %s\n", info->sn); */ 425 owl_function_debugmsg("doing faimtest_parse_authresp"); 402 426 owl_function_debugmsg("faimtest_parse_authresp: %s", info->sn); 403 427 … … 411 435 */ 412 436 if (info->errorcode==0x05) { 413 /* Incorrect nick/password */414 437 owl_aim_login_error("Incorrect nickname or password."); 415 438 } else if (info->errorcode==0x11) { 416 /* Suspended account */417 439 owl_aim_login_error("Your account is currently suspended."); 418 440 } else if (info->errorcode==0x14) { 419 /* service temporarily unavailable */420 441 owl_aim_login_error("The AOL Instant Messenger service is temporarily unavailable."); 421 442 } else if (info->errorcode==0x18) { 422 /* connecting too frequently */423 443 owl_aim_login_error("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."); 424 444 } else if (info->errorcode==0x1c) { 425 /* client too old */426 445 owl_aim_login_error("The client version you are using is too old."); 427 446 } else { … … 429 448 } 430 449 aim_conn_kill(sess, &fr->conn); 431 return 1;450 return(1); 432 451 } 433 452 … … 442 461 if (!(bosconn = aim_newconn(sess, AIM_CONN_TYPE_BOS, info->bosip))) { 443 462 /* printf("could not connect to BOS: internal error\n"); */ 444 return 1;463 return(1); 445 464 } else if (bosconn->status & AIM_CONN_STATUS_CONNERR) { 446 465 /* printf("could not connect to BOS\n"); */ 447 466 aim_conn_kill(sess, &bosconn); 448 return 1;467 return(1); 449 468 } 450 469 owl_global_set_bossconn(&g, bosconn); … … 452 471 addcb_bos(sess, bosconn); 453 472 aim_sendcookie(sess, bosconn, info->cookielen, info->cookie); 454 return 1;473 return(1); 455 474 } 456 475 457 476 int faimtest_flapversion(aim_session_t *sess, aim_frame_t *fr, ...) 458 477 { 478 owl_function_debugmsg("doing faimtest_flapversion"); 479 459 480 #if 0 460 481 /* XXX fix libfaim to support this */ … … 478 499 int faimtest_conncomplete(aim_session_t *sess, aim_frame_t *fr, ...) 479 500 { 501 owl_function_debugmsg("doing faimtest_conncomplete"); 480 502 /* owl_aim_successful_login(info->sn); */ 481 482 503 return 1; 483 504 } … … 485 506 void addcb_bos(aim_session_t *sess, aim_conn_t *bosconn) 486 507 { 487 508 owl_function_debugmsg("doing addcb_bos"); 488 509 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNCOMPLETE, faimtest_conncomplete, 0); 489 510 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_bos, 0); … … 523 544 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_ICQ, AIM_CB_ICQ_OFFLINEMSGCOMPLETE, offlinemsgdone, 0); 524 545 525 #ifdef MID_REWROTE_ALL_THE_CRAP526 aim_conn_addhandler(sess, bosconn, 0xffff, 0xffff, faimtest_parse_unknown, 0);527 #endif528 529 546 return; 530 547 } 531 548 532 533 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) { 549 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...) 550 { 551 owl_function_debugmsg("doing coninitdone_bos"); 534 552 aim_reqpersonalinfo(sess, fr->conn); 535 553 536 #ifndef NOSSI537 554 aim_ssi_reqrights(sess); 538 555 aim_ssi_reqdata(sess); 539 #endif540 556 541 557 aim_bos_reqlocaterights(sess, fr->conn); … … 544 560 aim_bos_reqrights(sess, fr->conn); /* XXX - Don't call this with ssi? */ 545 561 546 #ifdef NOSSI 562 aim_bos_setprofile(owl_global_get_aimsess(&g), fr->conn, NULL, NULL, 0, NULL, NULL, 0, AIM_CAPS_CHAT); 563 564 #ifdef NOSSI 565 /* 547 566 aim_bos_setgroupperm(sess, fr->conn, AIM_FLAG_ALLUSERS); 548 567 aim_bos_setprivacyflags(sess, fr->conn, AIM_PRIVFLAGS_ALLOWIDLE | AIM_PRIVFLAGS_ALLOWMEMBERSINCE); 549 #endif 550 551 return 1; 568 */ 569 #endif 570 571 return(1); 552 572 } 553 573 … … 763 783 /* printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); */ 764 784 aim_clientready(sess, fr->conn); 765 /* printf("officially connected to BOS.\n"); */785 owl_function_debugmsg("officially connected to BOS."); 766 786 aim_icq_reqofflinemsgs(sess); 767 787 return 1; … … 776 796 maxsiglen = va_arg(ap, int); 777 797 va_end(ap); 778 798 779 799 /* printf("locate rights: max signature length = %d\n", maxsiglen); */ 780 800 781 return 1;801 return(1); 782 802 } 783 803 … … 1048 1068 return(1); 1049 1069 1070 /* 1050 1071 printf("userinfo: sn: %s\n", userinfo->sn); 1051 1072 printf("userinfo: warnlevel: %f\n", aim_userinfo_warnlevel(userinfo)); … … 1053 1074 printuserflags(userinfo->flags); 1054 1075 printf("\n"); 1076 */ 1055 1077 1056 1078 /* … … 1062 1084 1063 1085 if (inforeq == AIM_GETINFO_GENERALINFO) { 1064 printf("userinfo: profile_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");1065 printf("userinfo: prof: %s\n", prof ? prof : "[none]");1086 owl_function_debugmsg("userinfo: profile_encoding: %s\n", prof_encoding ? prof_encoding : "[none]"); 1087 owl_function_debugmsg("userinfo: prof: %s\n", prof ? prof : "[none]"); 1066 1088 } else if (inforeq == AIM_GETINFO_AWAYMESSAGE) { 1067 printf("userinfo: awaymsg_encoding: %s\n", prof_encoding ? prof_encoding : "[none]");1068 printf("userinfo: awaymsg: %s\n", prof ? prof : "[none]");1089 owl_function_debugmsg("userinfo: awaymsg_encoding: %s\n", prof_encoding ? prof_encoding : "[none]"); 1090 owl_function_debugmsg("userinfo: awaymsg: %s\n", prof ? prof : "[none]"); 1069 1091 } else if (inforeq == AIM_GETINFO_CAPABILITIES) { 1070 printf("userinfo: capabilities: see above\n");1092 owl_function_debugmsg("userinfo: capabilities: see above\n"); 1071 1093 } else { 1072 printf("userinfo: unknown info request\n");1073 } 1074 1075 return 1;1094 owl_function_debugmsg("userinfo: unknown info request\n"); 1095 } 1096 1097 return(1); 1076 1098 } 1077 1099 … … 1435 1457 } 1436 1458 1437 return 1;1459 return(1); 1438 1460 } 1439 1461 … … 1461 1483 /* printf("send file!\n"); */ 1462 1484 } else if (args->reqclass == AIM_CAPS_CHAT) { 1485 owl_function_debugmsg("chat invite: %s, %i, %i", args->info.chat.roominfo.name, args->info.chat.roominfo.exchange, args->info.chat.roominfo.instance); 1463 1486 /* 1464 1487 printf("chat invitation: room name = %s\n", args->info.chat.roominfo.name); … … 1538 1561 owl_buddy_set_idle_since(b, userinfo->idletime); 1539 1562 } 1563 1564 if (userinfo->flags & AIM_FLAG_AWAY) { 1565 owl_function_debugmsg("parse_oncoming sn: %s away flag!", userinfo->sn); 1566 } 1567 1540 1568 owl_function_debugmsg("parse_oncoming sn: %s idle: %i", userinfo->sn, userinfo->idletime); 1541 1569 … … 1871 1899 static int ssirights(aim_session_t *sess, aim_frame_t *fr, ...) 1872 1900 { 1873 1874 1901 /* printf("got SSI rights, requesting data\n"); */ 1875 1902 /* aim_ssi_reqdata(sess, fr->conn, 0, 0x0000); */ 1876 1903 aim_ssi_reqdata(sess); 1877 1904 1878 return 1;1905 return(1); 1879 1906 } 1880 1907 … … 1956 1983 va_end(ap); 1957 1984 1985 owl_function_debugmsg("In faimtest_chat_join"); 1958 1986 /* 1959 1987 printf("chat: %s: New occupants have joined:\n", aim_chat_getname(fr->conn)); … … 2015 2043 va_end(ap); 2016 2044 2045 owl_function_debugmsg("In faimtest_chat_infoupdate"); 2017 2046 /* 2018 2047 printf("chat: %s: info update:\n", croomname); … … 2025 2054 printf("chat: %s: \t\t%s\n", croomname, userinfo[i].sn); 2026 2055 2027 printf("chat: %s: \tRoom flags: 0x%04x (%s%s%s%s)\n",2056 owl_function_debugmsg("chat: %s: \tRoom flags: 0x%04x (%s%s%s%s)\n", 2028 2057 croomname, flags, 2029 2058 (flags & AIM_CHATROOM_FLAG_EVILABLE) ? "Evilable, " : "", … … 2038 2067 */ 2039 2068 2040 return 1;2069 return(1); 2041 2070 } 2042 2071 … … 2052 2081 msg = va_arg(ap, char *); 2053 2082 va_end(ap); 2083 2084 owl_function_debugmsg("in faimtest_chat_incomingmsg"); 2054 2085 2055 2086 /* … … 2075 2106 va_start(ap, fr); 2076 2107 type = (fu16_t)va_arg(ap, unsigned int); 2108 2109 owl_function_debugmsg("in faimtest_chatnav_info"); 2077 2110 2078 2111 if (type == 0x0002) { … … 2136 2169 { 2137 2170 2171 owl_function_debugmsg("in faimtest_conninitdone_chat"); 2172 2138 2173 aim_clientready(sess, fr->conn); 2139 2174 … … 2145 2180 } else if (fr->conn->type == AIM_CONN_TYPE_CHAT) { 2146 2181 /* printf("chat ready\n"); */ 2182 owl_function_debugmsg("Chat ready"); 2147 2183 aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0); 2148 2184 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0); … … 2157 2193 { 2158 2194 aim_conn_t *tstconn; 2195 2196 owl_function_debugmsg("in faimtest_chatnav_redirect"); 2159 2197 2160 2198 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, redir->ip); … … 2177 2215 { 2178 2216 aim_conn_t *tstconn; 2217 2218 owl_function_debugmsg("in chat_redirect"); 2179 2219 2180 2220 tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, redir->ip);
Note: See TracChangeset
for help on using the changeset viewer.