Mercurial > pidgin.yaz
comparison src/oscar.c @ 276:9e6fc62490cd
[gaim-migrate @ 286]
receive messages faster
committer: Tailor Script <tailor@pidgin.im>
author | Eric Warmenhoven <eric@warmenhoven.org> |
---|---|
date | Sun, 28 May 2000 21:38:54 +0000 |
parents | 4dc94ab60421 |
children | bba300ed4fab |
comparison
equal
deleted
inserted
replaced
275:f9eb3eb9ffde | 276:9e6fc62490cd |
---|---|
39 #include "gnome_applet_mgr.h" | 39 #include "gnome_applet_mgr.h" |
40 | 40 |
41 static int inpa = -1; | 41 static int inpa = -1; |
42 struct aim_session_t *gaim_sess; | 42 struct aim_session_t *gaim_sess; |
43 struct aim_conn_t *gaim_conn; | 43 struct aim_conn_t *gaim_conn; |
44 int gaim_caps = AIM_CAPS_CHAT | AIM_CAPS_SENDFILE | AIM_CAPS_GETFILE; | |
44 | 45 |
45 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...); | 46 static int gaim_parse_auth_resp (struct aim_session_t *, struct command_rx_struct *, ...); |
46 static int gaim_auth_server_ready(struct aim_session_t *, struct command_rx_struct *, ...); | 47 static int gaim_auth_server_ready(struct aim_session_t *, struct command_rx_struct *, ...); |
47 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); | 48 static int gaim_server_ready (struct aim_session_t *, struct command_rx_struct *, ...); |
48 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); | 49 static int gaim_handle_redirect (struct aim_session_t *, struct command_rx_struct *, ...); |
252 return 1; | 253 return 1; |
253 } | 254 } |
254 | 255 |
255 int gaim_server_ready(struct aim_session_t *sess, | 256 int gaim_server_ready(struct aim_session_t *sess, |
256 struct command_rx_struct *command, ...) { | 257 struct command_rx_struct *command, ...) { |
258 static int id = 1; | |
257 switch (command->conn->type) { | 259 switch (command->conn->type) { |
258 case AIM_CONN_TYPE_BOS: | 260 case AIM_CONN_TYPE_BOS: |
259 aim_bos_reqrate(sess, command->conn); | 261 aim_bos_reqrate(sess, command->conn); |
260 aim_bos_ackrateresp(sess, command->conn); | 262 aim_bos_ackrateresp(sess, command->conn); |
261 aim_bos_setprivacyflags(sess, command->conn, 0x00000003); | 263 aim_bos_setprivacyflags(sess, command->conn, 0x00000003); |
277 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); | 279 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); |
278 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); | 280 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); |
279 aim_bos_reqrate(sess, command->conn); | 281 aim_bos_reqrate(sess, command->conn); |
280 aim_bos_ackrateresp(sess, command->conn); | 282 aim_bos_ackrateresp(sess, command->conn); |
281 aim_chat_clientready(sess, command->conn); | 283 aim_chat_clientready(sess, command->conn); |
284 serv_got_joined_chat(id++, aim_chat_getname(command->conn)); | |
282 break; | 285 break; |
283 default: /* huh? */ | 286 default: /* huh? */ |
284 break; | 287 break; |
285 } | 288 } |
286 return 1; | 289 return 1; |
306 cookie = va_arg(ap, char *); | 309 cookie = va_arg(ap, char *); |
307 | 310 |
308 switch(serviceid) { | 311 switch(serviceid) { |
309 case 0x0005: /* Ads */ | 312 case 0x0005: /* Ads */ |
310 aim_bos_setbuddylist(sess, command->conn, buddies); | 313 aim_bos_setbuddylist(sess, command->conn, buddies); |
311 aim_bos_setprofile(sess, command->conn, profile, | 314 aim_bos_setprofile(sess, command->conn, profile, NULL, |
312 NULL, AIM_CAPS_CHAT); | 315 gaim_caps); |
316 | |
317 aim_seticbmparam(sess, command->conn); | |
313 | 318 |
314 aim_bos_clientready(sess, command->conn); | 319 aim_bos_clientready(sess, command->conn); |
315 | 320 |
316 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); | 321 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); |
317 | 322 |
339 serv_finish_login(); | 344 serv_finish_login(); |
340 gaim_setup(); | 345 gaim_setup(); |
341 if (bud_list_cache_exists()) | 346 if (bud_list_cache_exists()) |
342 do_import(NULL, 0); | 347 do_import(NULL, 0); |
343 | 348 |
349 aim_conn_setlatency(command->conn, 1); | |
350 | |
344 break; | 351 break; |
345 case 0x7: /* Authorizer */ | 352 case 0x7: /* Authorizer */ |
346 { | 353 { |
347 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip); | 354 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip); |
348 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) | 355 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) |
364 debug_print("chatnav: connected\n"); | 371 debug_print("chatnav: connected\n"); |
365 break; | 372 break; |
366 case 0xe: /* Chat */ | 373 case 0xe: /* Chat */ |
367 { | 374 { |
368 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip); | 375 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip); |
369 static int id = 1; | |
370 char *roomname = va_arg(ap, char *); | 376 char *roomname = va_arg(ap, char *); |
371 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { | 377 if (tstconn == NULL || tstconn->status >= AIM_CONN_STATUS_RESOLVERR) { |
372 debug_print("unable to connect to chat server\n"); | 378 debug_print("unable to connect to chat server\n"); |
373 return 1; | 379 return 1; |
374 } | 380 } |
375 aim_chat_attachname(tstconn, roomname); | 381 aim_chat_attachname(tstconn, roomname); |
376 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); | 382 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); |
377 aim_auth_sendcookie(sess, tstconn, cookie); | 383 aim_auth_sendcookie(sess, tstconn, cookie); |
378 serv_got_joined_chat(id++, roomname); | |
379 } | 384 } |
380 break; | 385 break; |
381 default: /* huh? */ | 386 default: /* huh? */ |
382 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", | 387 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", |
383 serviceid); | 388 serviceid); |
576 | 581 |
577 int gaim_chatnav_info(struct aim_session_t *sess, | 582 int gaim_chatnav_info(struct aim_session_t *sess, |
578 struct command_rx_struct *command, ...) { | 583 struct command_rx_struct *command, ...) { |
579 /* FIXME */ | 584 /* FIXME */ |
580 debug_print("inside chatnav_info\n"); | 585 debug_print("inside chatnav_info\n"); |
586 aim_conn_close(command->conn); | |
581 return 1; | 587 return 1; |
582 } | 588 } |
583 | 589 |
584 int gaim_chat_join(struct aim_session_t *sess, | 590 int gaim_chat_join(struct aim_session_t *sess, |
585 struct command_rx_struct *command, ...) { | 591 struct command_rx_struct *command, ...) { |