- Timestamp:
- Dec 19, 2003, 11:41:48 AM (21 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:
- c8735aa
- Parents:
- e7bcd1b
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
aim.c
re7bcd1b r2674412 63 63 static int conninitdone_bos(aim_session_t *sess, aim_frame_t *fr, ...); 64 64 static int conninitdone_admin(aim_session_t *sess, aim_frame_t *fr, ...); 65 static int conninitdone_chatnav (aim_session_t *, aim_frame_t *, ...); 66 static int conninitdone_chat (aim_session_t *, aim_frame_t *, ...); 65 67 int logout(aim_session_t *sess); 66 68 … … 121 123 void owl_aim_init(void) 122 124 { 123 /* aim_session_init(owl_global_get_aimsess(&g), AIM_SESS_FLAGS_NONBLOCKCONNECT, 0); */ 124 125 /* 126 aim_session_init(owl_global_get_aimsess(&g), TRUE, 0); 127 aim_setdebuggingcb(owl_global_get_aimsess(&g), faimtest_debugcb); 128 aim_tx_setenqueue(owl_global_get_aimsess(&g), AIM_TX_IMMEDIATE, NULL); 129 */ 130 /* an experiment to expose idle time */ 131 /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */ 125 /* this has all been moved to owl_aim_login, but we'll leave the 126 * function here, in case there's stuff we want to init in the 127 * future. It's still called by Owl. 128 */ 129 132 130 } 133 131 … … 217 215 owl_global_get_aim_ignorelogin_timer(&g)); 218 216 217 218 /* aim_ssi_setpresence(owl_global_get_aimsess(&g), 0x00000400); */ 219 219 /* aim_bos_setidle(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), 5000); */ 220 220 } … … 285 285 /* there is a max away message lentgh we should check against */ 286 286 287 /*288 287 aim_bos_setprofile(owl_global_get_aimsess(&g), 289 288 owl_global_get_bosconn(&g), 290 289 NULL, NULL, 0, "us-ascii", msg, 291 290 strlen(msg), 0); 292 */293 291 return(0); 294 292 } 295 293 296 void owl_aim_chat_join(char * chatroom, int exchange)294 void owl_aim_chat_join(char *name, int exchange) 297 295 { 298 296 int ret; 297 aim_conn_t *cur; 298 /* 299 OscarData *od = (OscarData *)g->proto_data; 300 char *name, *exchange; 301 */ 302 303 owl_function_debugmsg("Attempting to join chatroom %s exchange %i", name, exchange); 304 305 /* 306 name = g_hash_table_lookup(data, "room"); 307 exchange = g_hash_table_lookup(data, "exchange"); 308 */ 309 if ((cur = aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV))) { 310 owl_function_debugmsg("owl_aim_chat_join: chatnav exists, creating room"); 311 aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange); 312 } else { 313 /* struct create_room *cr = g_new0(struct create_room, 1); */ 314 owl_function_debugmsg("owl_aim_chat_join: chatnav does not exist, opening chatnav"); 315 /* 316 cr->exchange = atoi(exchange); 317 cr->name = g_strdup(name); 318 od->create_rooms = g_slist_append(od->create_rooms, cr); 319 */ 320 /* aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV); */ 321 aim_reqservice(owl_global_get_aimsess(&g), NULL, AIM_CONN_TYPE_CHATNAV); 322 aim_chatnav_createroom(owl_global_get_aimsess(&g), cur, name, exchange); 323 ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000); 324 325 } 326 return; 327 /******/ 328 299 329 300 330 /* ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); */ … … 306 336 aim_reqservice(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), AIM_CONN_TYPE_CHATNAV); 307 337 ret = aim_chatnav_createroom(owl_global_get_aimsess(&g), 308 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), chatroom, exchange); 309 ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, chatroom, 0x0000); 310 311 owl_function_debugmsg("Attempting to join chatroom %s exchange %i", chatroom, exchange); 338 aim_getconn_type(owl_global_get_aimsess(&g), AIM_CONN_TYPE_CHATNAV), name, exchange); 339 ret=aim_chat_join(owl_global_get_aimsess(&g), owl_global_get_bosconn(&g), exchange, name, 0x0000); 340 312 341 } 313 342 … … 555 584 556 585 /* 586 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNERR, gaim_connerr, 0); 587 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SPECIAL, AIM_CB_SPECIAL_CONNINITDONE, conninitdone_chatnav, 0); 588 */ 589 590 /* 557 591 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_ERROR, faimtest_ssi_parseerr, 0); 558 592 aim_conn_addhandler(sess, bosconn, AIM_CB_FAM_SSI, AIM_CB_SSI_RIGHTSINFO, faimtest_ssi_parserights, 0); … … 675 709 va_list ap; 676 710 struct aim_redirect_data *redir; 711 712 owl_function_debugmsg("faimtest_handledirect:"); 677 713 678 714 va_start(ap, fr); … … 683 719 } else if (redir->group == 0x0007) { /* Authorizer */ 684 720 aim_conn_t *tstconn; 721 722 owl_function_debugmsg("faimtest_handledirect: autorizer"); 685 723 686 724 tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, redir->ip); … … 699 737 } 700 738 } else if (redir->group == 0x000d) { /* ChatNav */ 739 owl_function_debugmsg("faimtest_handledirect: chatnav"); 701 740 chatnav_redirect(sess, redir); 702 741 } else if (redir->group == 0x000e) { /* Chat */ 742 owl_function_debugmsg("faimtest_handledirect: chat"); 703 743 chat_redirect(sess, redir); 704 744 } else { … … 2139 2179 static int conninitdone_chat(aim_session_t *sess, aim_frame_t *fr, ...) 2140 2180 { 2141 2142 owl_function_debugmsg("in faimtest_conninitdone_chat"); 2181 owl_function_debugmsg("faimtest_conninitdone_chat:"); 2182 2183 aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0); 2184 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0); 2185 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0); 2186 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0); 2187 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0); 2143 2188 2144 2189 aim_clientready(sess, fr->conn); 2145 2190 2146 if (fr->conn->type == AIM_CONN_TYPE_CHATNAV) { 2147 /* printf("chatnav ready\n"); */ 2148 aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, faimtest_parse_genericerr, 0); 2149 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, faimtest_chatnav_info, 0); 2150 aim_chatnav_reqrights(sess, fr->conn); 2151 } else if (fr->conn->type == AIM_CONN_TYPE_CHAT) { 2152 /* printf("chat ready\n"); */ 2153 owl_function_debugmsg("Chat ready"); 2154 aim_conn_addhandler(sess, fr->conn, 0x000e, 0x0001, faimtest_parse_genericerr, 0); 2155 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, faimtest_chat_join, 0); 2156 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, faimtest_chat_leave, 0); 2157 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, faimtest_chat_infoupdate, 0); 2158 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, faimtest_chat_incomingmsg, 0); 2159 } 2160 return 1; 2191 owl_function_debugmsg("Chat ready"); 2192 2193 /* 2194 chatcon = find_oscar_chat_by_conn(gc, fr->conn); 2195 chatcon->id = id; 2196 chatcon->cnv = serv_got_joined_chat(gc, id++, chatcon->show); 2197 */ 2198 return(1); 2199 } 2200 2201 static int conninitdone_chatnav(aim_session_t *sess, aim_frame_t *fr, ...) 2202 { 2203 owl_function_debugmsg("faimtest_conninitdone_chatnav:"); 2204 2205 aim_conn_addhandler(sess, fr->conn, 0x000d, 0x0001, gaim_parse_genericerr, 0); 2206 aim_conn_addhandler(sess, fr->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); 2207 2208 aim_clientready(sess, fr->conn); 2209 2210 aim_chatnav_reqrights(sess, fr->conn); 2211 2212 return(1); 2161 2213 } 2162 2214
Note: See TracChangeset
for help on using the changeset viewer.