comparison src/oscar.c @ 1250:b5783215b245

[gaim-migrate @ 1260] decklin's clean up of the account editor, much needed. indent -kr -i8 -l105 -ncs -cp7 -npcs -T GtkWidget -T gpointer -T AppletCallbackFunc -T GtkFunction -T gaim_plugin_remove -T name -T FILE -T gchar -T user_opts -T GdkEvent -T GtkObject ... did about.c, aim.c, away.c, browser.c, buddy_chat.c, gaimrc.c, html.c, idle.c, multi.c. Need to do buddy.c, conversation.c, dialogs.c, oscar.c, perl.c, plugins.c, prefs.c, proxy.c, prpl.c, rvous.c, server.c, sound.c, toc.c, util.c. not doing gtkhtml.c because it's a piece of crap anyway, or *ticker.c because they're syd's. got rid of debug_buff, just debug_printf now. committer: Tailor Script <tailor@pidgin.im>
author Eric Warmenhoven <eric@warmenhoven.org>
date Wed, 13 Dec 2000 20:18:35 +0000
parents f50146ce818e
children 07f0bb41bbe1
comparison
equal deleted inserted replaced
1249:3e44de27622d 1250:b5783215b245
290 struct gaim_connection *gc = find_gaim_conn_by_oscar_conn(conn); 290 struct gaim_connection *gc = find_gaim_conn_by_oscar_conn(conn);
291 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; 291 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
292 if (!g_slist_find(connections, gc)) { 292 if (!g_slist_find(connections, gc)) {
293 /* oh boy. this is probably bad. i guess the only thing we can really do 293 /* oh boy. this is probably bad. i guess the only thing we can really do
294 * is return? */ 294 * is return? */
295 debug_print("oscar callback for closed connection.\n"); 295 debug_printf("oscar callback for closed connection.\n");
296 return; 296 return;
297 } 297 }
298 298
299 if (condition & GDK_INPUT_EXCEPTION) { 299 if (condition & GDK_INPUT_EXCEPTION) {
300 hide_login_progress(gc, _("Disconnected.")); 300 hide_login_progress(gc, _("Disconnected."));
301 signoff(gc); 301 signoff(gc);
302 return; 302 return;
303 } 303 }
304 if (condition & GDK_INPUT_READ) { 304 if (condition & GDK_INPUT_READ) {
305 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) { 305 if (conn->type == AIM_CONN_TYPE_RENDEZVOUS_OUT) {
306 debug_print("got information on rendezvous\n"); 306 debug_printf("got information on rendezvous\n");
307 if (aim_handlerendconnect(odata->sess, conn) < 0) { 307 if (aim_handlerendconnect(odata->sess, conn) < 0) {
308 debug_print(_("connection error (rend)\n")); 308 debug_printf(_("connection error (rend)\n"));
309 } 309 }
310 } else { 310 } else {
311 if (aim_get_command(odata->sess, conn) >= 0) { 311 if (aim_get_command(odata->sess, conn) >= 0) {
312 aim_rxdispatch(odata->sess); 312 aim_rxdispatch(odata->sess);
313 } else { 313 } else {
314 if ((conn->type == AIM_CONN_TYPE_BOS) || 314 if ((conn->type == AIM_CONN_TYPE_BOS) ||
315 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) { 315 !(aim_getconn_type(odata->sess, AIM_CONN_TYPE_BOS))) {
316 debug_print(_("major connection error\n")); 316 debug_printf(_("major connection error\n"));
317 hide_login_progress(gc, _("Disconnected.")); 317 hide_login_progress(gc, _("Disconnected."));
318 signoff(gc); 318 signoff(gc);
319 } else if (conn->type == AIM_CONN_TYPE_CHAT) { 319 } else if (conn->type == AIM_CONN_TYPE_CHAT) {
320 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn); 320 struct chat_connection *c = find_oscar_chat_by_conn(gc, conn);
321 char buf[BUF_LONG]; 321 char buf[BUF_LONG];
322 sprintf(debug_buff, "disconnected from chat room %s\n", c->name); 322 debug_printf("disconnected from chat room %s\n", c->name);
323 debug_print(debug_buff);
324 c->conn = NULL; 323 c->conn = NULL;
325 if (c->inpa > -1) 324 if (c->inpa > -1)
326 gdk_input_remove(c->inpa); 325 gdk_input_remove(c->inpa);
327 c->inpa = -1; 326 c->inpa = -1;
328 c->fd = -1; 327 c->fd = -1;
331 do_error_dialog(buf, _("Chat Error!")); 330 do_error_dialog(buf, _("Chat Error!"));
332 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) { 331 } else if (conn->type == AIM_CONN_TYPE_CHATNAV) {
333 if (odata->cnpa > -1) 332 if (odata->cnpa > -1)
334 gdk_input_remove(odata->cnpa); 333 gdk_input_remove(odata->cnpa);
335 odata->cnpa = -1; 334 odata->cnpa = -1;
336 debug_print("removing chatnav input watcher\n"); 335 debug_printf("removing chatnav input watcher\n");
337 aim_conn_kill(odata->sess, &conn); 336 aim_conn_kill(odata->sess, &conn);
338 } else if (conn->type == AIM_CONN_TYPE_RENDEZVOUS) { 337 } else if (conn->type == AIM_CONN_TYPE_RENDEZVOUS) {
339 debug_printf("No handler for rendezvous disconnect (%d).\n", 338 debug_printf("No handler for rendezvous disconnect (%d).\n",
340 source); 339 source);
341 aim_conn_kill(odata->sess, &conn); 340 aim_conn_kill(odata->sess, &conn);
342 } else { 341 } else {
343 sprintf(debug_buff, "holy crap! generic connection error! %d\n", 342 debug_printf("holy crap! generic connection error! %d\n",
344 conn->type); 343 conn->type);
345 debug_print(debug_buff);
346 aim_conn_kill(odata->sess, &conn); 344 aim_conn_kill(odata->sess, &conn);
347 } 345 }
348 } 346 }
349 } 347 }
350 } 348 }
357 char *finalauth = NULL; 355 char *finalauth = NULL;
358 struct gaim_connection *gc = new_gaim_conn(user); 356 struct gaim_connection *gc = new_gaim_conn(user);
359 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); 357 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1);
360 odata->create_exchange = 0; 358 odata->create_exchange = 0;
361 359
362 sprintf(debug_buff, _("Logging in %s\n"), user->username); 360 debug_printf(_("Logging in %s\n"), user->username);
363 debug_print(debug_buff);
364 361
365 sess = g_new0(struct aim_session_t, 1); 362 sess = g_new0(struct aim_session_t, 1);
366 363
367 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT); 364 aim_session_init(sess, AIM_SESS_FLAGS_NONBLOCKCONNECT);
368 365
394 391
395 if (finalauth) 392 if (finalauth)
396 g_free(finalauth); 393 g_free(finalauth);
397 394
398 if (conn == NULL) { 395 if (conn == NULL) {
399 debug_print(_("internal connection error\n")); 396 debug_printf(_("internal connection error\n"));
400 hide_login_progress(gc, _("Unable to login to AIM")); 397 hide_login_progress(gc, _("Unable to login to AIM"));
401 signoff(gc); 398 signoff(gc);
402 return; 399 return;
403 } else if (conn->fd == -1) { 400 } else if (conn->fd == -1) {
404 if (conn->status & AIM_CONN_STATUS_RESOLVERR) { 401 if (conn->status & AIM_CONN_STATUS_RESOLVERR) {
405 sprintf(debug_buff, _("couldn't resolve host")); 402 char *crh = _("couldn't resolve host");
406 debug_print(debug_buff); debug_print("\n"); 403 debug_printf("%s\n", crh);
407 hide_login_progress(gc, debug_buff); 404 hide_login_progress(gc, crh);
408 } else if (conn->status & AIM_CONN_STATUS_CONNERR) { 405 } else if (conn->status & AIM_CONN_STATUS_CONNERR) {
409 sprintf(debug_buff, _("couldn't connect to host")); 406 char *cch = _("couldn't connect to host");
410 debug_print(debug_buff); debug_print("\n"); 407 debug_printf("%s\n", cch);
411 hide_login_progress(gc, debug_buff); 408 hide_login_progress(gc, cch);
412 } 409 }
413 signoff(gc); 410 signoff(gc);
414 return; 411 return;
415 } 412 }
416 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); 413 g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username);
421 aim_request_login(sess, conn, gc->username); 418 aim_request_login(sess, conn, gc->username);
422 419
423 gc->inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, 420 gc->inpa = gdk_input_add(conn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
424 oscar_callback, conn); 421 oscar_callback, conn);
425 422
426 debug_print(_("Password sent, waiting for response\n")); 423 debug_printf(_("Password sent, waiting for response\n"));
427 } 424 }
428 425
429 void oscar_close(struct gaim_connection *gc) { 426 void oscar_close(struct gaim_connection *gc) {
430 struct oscar_data *odata = (struct oscar_data *)gc->proto_data; 427 struct oscar_data *odata = (struct oscar_data *)gc->proto_data;
431 GSList *c = odata->oscar_chats; 428 GSList *c = odata->oscar_chats;
446 if (odata->paspa > 0) 443 if (odata->paspa > 0)
447 gdk_input_remove(odata->paspa); 444 gdk_input_remove(odata->paspa);
448 aim_logoff(odata->sess); 445 aim_logoff(odata->sess);
449 g_free(odata->sess); 446 g_free(odata->sess);
450 g_free(gc->proto_data); 447 g_free(gc->proto_data);
451 debug_print(_("Signed off.\n")); 448 debug_printf(_("Signed off.\n"));
452 } 449 }
453 450
454 int gaim_parse_auth_resp(struct aim_session_t *sess, 451 int gaim_parse_auth_resp(struct aim_session_t *sess,
455 struct command_rx_struct *command, ...) { 452 struct command_rx_struct *command, ...) {
456 va_list ap; 453 va_list ap;
484 latestbetaurl = va_arg(ap, char *); 481 latestbetaurl = va_arg(ap, char *);
485 latestbetainfo = va_arg(ap, char *); 482 latestbetainfo = va_arg(ap, char *);
486 483
487 va_end(ap); 484 va_end(ap);
488 485
489 sprintf(debug_buff, "inside auth_resp (Screen name: %s)\n", sn); 486 debug_printf("inside auth_resp (Screen name: %s)\n", sn);
490 debug_print(debug_buff);
491 487
492 if (errorcode || !bosip || !cookie) { 488 if (errorcode || !bosip || !cookie) {
493 switch (errorcode) { 489 switch (errorcode) {
494 case 0x18: 490 case 0x18:
495 /* connecting too frequently */ 491 /* connecting too frequently */
606 struct chat_connection *chatcon; 602 struct chat_connection *chatcon;
607 switch (command->conn->type) { 603 switch (command->conn->type) {
608 case AIM_CONN_TYPE_BOS: 604 case AIM_CONN_TYPE_BOS:
609 aim_setversions(sess, command->conn); 605 aim_setversions(sess, command->conn);
610 aim_bos_reqrate(sess, command->conn); /* request rate info */ 606 aim_bos_reqrate(sess, command->conn); /* request rate info */
611 debug_print("done with BOS ServerReady\n"); 607 debug_printf("done with BOS ServerReady\n");
612 break; 608 break;
613 case AIM_CONN_TYPE_CHATNAV: 609 case AIM_CONN_TYPE_CHATNAV:
614 debug_print("chatnav: got server ready\n"); 610 debug_printf("chatnav: got server ready\n");
615 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0); 611 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CTN, AIM_CB_CTN_INFO, gaim_chatnav_info, 0);
616 aim_bos_reqrate(sess, command->conn); 612 aim_bos_reqrate(sess, command->conn);
617 aim_bos_ackrateresp(sess, command->conn); 613 aim_bos_ackrateresp(sess, command->conn);
618 aim_chatnav_clientready(sess, command->conn); 614 aim_chatnav_clientready(sess, command->conn);
619 aim_chatnav_reqrights(sess, command->conn); 615 aim_chatnav_reqrights(sess, command->conn);
620 break; 616 break;
621 case AIM_CONN_TYPE_CHAT: 617 case AIM_CONN_TYPE_CHAT:
622 debug_print("chat: got server ready\n"); 618 debug_printf("chat: got server ready\n");
623 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0); 619 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERJOIN, gaim_chat_join, 0);
624 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0); 620 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_USERLEAVE, gaim_chat_leave, 0);
625 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0); 621 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_ROOMINFOUPDATE, gaim_chat_info_update, 0);
626 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0); 622 aim_conn_addhandler(sess, command->conn, AIM_CB_FAM_CHT, AIM_CB_CHT_INCOMINGMSG, gaim_chat_incoming_msg, 0);
627 aim_bos_reqrate(sess, command->conn); 623 aim_bos_reqrate(sess, command->conn);
632 serv_got_joined_chat(gc, id++, aim_chat_getname(command->conn)); 628 serv_got_joined_chat(gc, id++, aim_chat_getname(command->conn));
633 break; 629 break;
634 case AIM_CONN_TYPE_RENDEZVOUS: 630 case AIM_CONN_TYPE_RENDEZVOUS:
635 break; 631 break;
636 default: /* huh? */ 632 default: /* huh? */
637 sprintf(debug_buff, "server ready: got unexpected connection type %04x\n", command->conn->type); 633 debug_printf("server ready: got unexpected connection type %04x\n", command->conn->type);
638 debug_print(debug_buff);
639 break; 634 break;
640 } 635 }
641 return 1; 636 return 1;
642 } 637 }
643 638
655 ip = va_arg(ap, char *); 650 ip = va_arg(ap, char *);
656 cookie = va_arg(ap, unsigned char *); 651 cookie = va_arg(ap, unsigned char *);
657 652
658 switch(serviceid) { 653 switch(serviceid) {
659 case 0x7: /* Authorizer */ 654 case 0x7: /* Authorizer */
660 debug_print("Reconnecting with authorizor...\n"); 655 debug_printf("Reconnecting with authorizor...\n");
661 { 656 {
662 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip); 657 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_AUTH, ip);
663 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) 658 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR)
664 debug_print("unable to reconnect with authorizer\n"); 659 debug_printf("unable to reconnect with authorizer\n");
665 else { 660 else {
666 odata->paspa = gdk_input_add(tstconn->fd, 661 odata->paspa = gdk_input_add(tstconn->fd,
667 GDK_INPUT_READ | GDK_INPUT_EXCEPTION, 662 GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
668 oscar_callback, tstconn); 663 oscar_callback, tstconn);
669 aim_auth_sendcookie(sess, tstconn, cookie); 664 aim_auth_sendcookie(sess, tstconn, cookie);
672 break; 667 break;
673 case 0xd: /* ChatNav */ 668 case 0xd: /* ChatNav */
674 { 669 {
675 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, ip); 670 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHATNAV, ip);
676 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { 671 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) {
677 debug_print("unable to connect to chatnav server\n"); 672 debug_printf("unable to connect to chatnav server\n");
678 return 1; 673 return 1;
679 } 674 }
680 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); 675 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
681 aim_auth_sendcookie(sess, tstconn, cookie); 676 aim_auth_sendcookie(sess, tstconn, cookie);
682 odata->cnpa = gdk_input_add(tstconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION, 677 odata->cnpa = gdk_input_add(tstconn->fd, GDK_INPUT_READ | GDK_INPUT_EXCEPTION,
683 oscar_callback, tstconn); 678 oscar_callback, tstconn);
684 } 679 }
685 debug_print("chatnav: connected\n"); 680 debug_printf("chatnav: connected\n");
686 break; 681 break;
687 case 0xe: /* Chat */ 682 case 0xe: /* Chat */
688 { 683 {
689 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip); 684 struct aim_conn_t *tstconn = aim_newconn(sess, AIM_CONN_TYPE_CHAT, ip);
690 char *roomname = va_arg(ap, char *); 685 char *roomname = va_arg(ap, char *);
691 int exchange = va_arg(ap, int); 686 int exchange = va_arg(ap, int);
692 struct chat_connection *ccon; 687 struct chat_connection *ccon;
693 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) { 688 if (tstconn == NULL || tstconn->status & AIM_CONN_STATUS_RESOLVERR) {
694 debug_print("unable to connect to chat server\n"); 689 debug_printf("unable to connect to chat server\n");
695 return 1; 690 return 1;
696 } 691 }
697 sprintf(debug_buff, "Connected to chat room %s exchange %d\n", roomname, exchange); 692 debug_printf("Connected to chat room %s exchange %d\n", roomname, exchange);
698 debug_print(debug_buff);
699 693
700 ccon = g_new0(struct chat_connection, 1); 694 ccon = g_new0(struct chat_connection, 1);
701 ccon->conn = tstconn; 695 ccon->conn = tstconn;
702 ccon->fd = tstconn->fd; 696 ccon->fd = tstconn->fd;
703 ccon->name = g_strdup(roomname); 697 ccon->name = g_strdup(roomname);
713 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0); 707 aim_conn_addhandler(sess, tstconn, 0x0001, 0x0003, gaim_server_ready, 0);
714 aim_auth_sendcookie(sess, tstconn, cookie); 708 aim_auth_sendcookie(sess, tstconn, cookie);
715 } 709 }
716 break; 710 break;
717 default: /* huh? */ 711 default: /* huh? */
718 sprintf(debug_buff, "got redirect for unknown service 0x%04x\n", 712 debug_printf("got redirect for unknown service 0x%04x\n", serviceid);
719 serviceid);
720 debug_print(debug_buff);
721 break; 713 break;
722 } 714 }
723 715
724 va_end(ap); 716 va_end(ap);
725 717
1202 d->priv = priv; 1194 d->priv = priv;
1203 g_snprintf(buf, sizeof buf, "%s has just asked to directly connect to %s.", 1195 g_snprintf(buf, sizeof buf, "%s has just asked to directly connect to %s.",
1204 userinfo->sn, gc->username); 1196 userinfo->sn, gc->username);
1205 do_ask_dialog(buf, d, accept_direct_im, cancel_direct_im); 1197 do_ask_dialog(buf, d, accept_direct_im, cancel_direct_im);
1206 } else { 1198 } else {
1207 sprintf(debug_buff, "Unknown rendtype %d\n", rendtype); 1199 debug_printf("Unknown rendtype %d\n", rendtype);
1208 debug_print(debug_buff);
1209 } 1200 }
1210 } 1201 }
1211 1202
1212 return 1; 1203 return 1;
1213 } 1204 }
1332 va_start(ap, command); 1323 va_start(ap, command);
1333 id = (u_short)va_arg(ap, u_int); 1324 id = (u_short)va_arg(ap, u_int);
1334 msg = va_arg(ap, char *); 1325 msg = va_arg(ap, char *);
1335 va_end(ap); 1326 va_end(ap);
1336 1327
1337 sprintf(debug_buff, "MOTD: %s (%d)\n", msg, id); 1328 debug_printf("MOTD: %s (%d)\n", msg, id);
1338 debug_print(debug_buff); 1329 debug_printf("Gaim %s / Libfaim %s\n", VERSION, aim_getbuildstring());
1339 sprintf(debug_buff, "Gaim %s / Libfaim %s\n",
1340 VERSION, aim_getbuildstring());
1341 debug_print(debug_buff);
1342 if (id != 4) 1330 if (id != 4)
1343 do_error_dialog(_("Your connection may be lost."), 1331 do_error_dialog(_("Your connection may be lost."),
1344 _("AOL error")); 1332 _("AOL error"));
1345 1333
1346 return 1; 1334 return 1;
1365 maxrooms = (u_char)va_arg(ap, u_int); 1353 maxrooms = (u_char)va_arg(ap, u_int);
1366 exchangecount = va_arg(ap, int); 1354 exchangecount = va_arg(ap, int);
1367 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *); 1355 exchanges = va_arg(ap, struct aim_chat_exchangeinfo *);
1368 va_end(ap); 1356 va_end(ap);
1369 1357
1370 debug_print("chat info: Chat Rights:\n"); 1358 debug_printf("chat info: Chat Rights:\n");
1371 sprintf(debug_buff, "chat info: \tMax Concurrent Rooms: %d\n", maxrooms); 1359 debug_printf("chat info: \tMax Concurrent Rooms: %d\n", maxrooms);
1372 debug_print(debug_buff); 1360 debug_printf("chat info: \tExchange List: (%d total)\n", exchangecount);
1373 sprintf(debug_buff, "chat info: \tExchange List: (%d total)\n", exchangecount);
1374 debug_print(debug_buff);
1375 while (i < exchangecount) 1361 while (i < exchangecount)
1376 debug_printf("chat info: \t\t%d\n", exchanges[i++].number); 1362 debug_printf("chat info: \t\t%d\n", exchanges[i++].number);
1377 if (odata->create_exchange) { 1363 if (odata->create_exchange) {
1378 debug_printf("creating room %s\n", odata->create_name); 1364 debug_printf("creating room %s\n", odata->create_name);
1379 aim_chatnav_createroom(sess, command->conn, odata->create_name, 1365 aim_chatnav_createroom(sess, command->conn, odata->create_name,
1412 aim_chat_join(odata->sess, odata->conn, exchange, ck); 1398 aim_chat_join(odata->sess, odata->conn, exchange, ck);
1413 } 1399 }
1414 break; 1400 break;
1415 default: 1401 default:
1416 va_end(ap); 1402 va_end(ap);
1417 sprintf(debug_buff, "chatnav info: unknown type (%04x)\n", type); 1403 debug_printf("chatnav info: unknown type (%04x)\n", type);
1418 debug_print(debug_buff);
1419 break; 1404 break;
1420 } 1405 }
1421 return 1; 1406 return 1;
1422 } 1407 }
1423 1408
1483 return 1; 1468 return 1;
1484 } 1469 }
1485 1470
1486 int gaim_chat_info_update(struct aim_session_t *sess, 1471 int gaim_chat_info_update(struct aim_session_t *sess,
1487 struct command_rx_struct *command, ...) { 1472 struct command_rx_struct *command, ...) {
1488 debug_print("inside chat_info_update\n"); 1473 debug_printf("inside chat_info_update\n");
1489 return 1; 1474 return 1;
1490 } 1475 }
1491 1476
1492 int gaim_chat_incoming_msg(struct aim_session_t *sess, 1477 int gaim_chat_incoming_msg(struct aim_session_t *sess,
1493 struct command_rx_struct *command, ...) { 1478 struct command_rx_struct *command, ...) {
1529 va_start(ap, command); 1514 va_start(ap, command);
1530 type = (u_short)va_arg(ap, u_int); 1515 type = (u_short)va_arg(ap, u_int);
1531 sn = va_arg(ap, char *); 1516 sn = va_arg(ap, char *);
1532 va_end(ap); 1517 va_end(ap);
1533 1518
1534 sprintf(debug_buff, "Sent message to %s.\n", sn); 1519 debug_printf("Sent message to %s.\n", sn);
1535 debug_print(debug_buff);
1536 1520
1537 return 1; 1521 return 1;
1538 } 1522 }
1539 1523
1540 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1524 int gaim_parse_ratechange(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1543 1527
1544 va_start(ap, command); 1528 va_start(ap, command);
1545 newrate = va_arg(ap, unsigned long); 1529 newrate = va_arg(ap, unsigned long);
1546 va_end(ap); 1530 va_end(ap);
1547 1531
1548 sprintf(debug_buff, "ratechange: %lu\n", newrate); 1532 debug_printf("ratechange: %lu\n", newrate);
1549 debug_print(debug_buff);
1550 1533
1551 return 1; 1534 return 1;
1552 } 1535 }
1553 1536
1554 int gaim_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1537 int gaim_parse_evilnotify(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1579 serv_finish_login(gc); 1562 serv_finish_login(gc);
1580 1563
1581 if (bud_list_cache_exists(gc)) 1564 if (bud_list_cache_exists(gc))
1582 do_import(NULL, gc); 1565 do_import(NULL, gc);
1583 1566
1584 debug_print("buddy list loaded\n"); 1567 debug_printf("buddy list loaded\n");
1585 1568
1586 aim_addicbmparam(sess, command->conn); 1569 aim_addicbmparam(sess, command->conn);
1587 aim_bos_reqicbmparaminfo(sess, command->conn); 1570 aim_bos_reqicbmparaminfo(sess, command->conn);
1588 1571
1589 aim_bos_reqrights(sess, command->conn); 1572 aim_bos_reqrights(sess, command->conn);
1591 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE | 1574 aim_bos_setprivacyflags(sess, command->conn, AIM_PRIVFLAGS_ALLOWIDLE |
1592 AIM_PRIVFLAGS_ALLOWMEMBERSINCE); 1575 AIM_PRIVFLAGS_ALLOWMEMBERSINCE);
1593 1576
1594 break; 1577 break;
1595 default: 1578 default:
1596 sprintf(debug_buff, "got rate response for unhandled connection type %04x\n", 1579 debug_printf("got rate response for unhandled connection type %04x\n",
1597 command->conn->type); 1580 command->conn->type);
1598 debug_print(debug_buff);
1599 break; 1581 break;
1600 } 1582 }
1601 1583
1602 return 1; 1584 return 1;
1603 } 1585 }
1604 1586
1605 int gaim_reportinterval(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1587 int gaim_reportinterval(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1606 if (command->data) { 1588 if (command->data) {
1607 sprintf(debug_buff, "minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10)); 1589 debug_printf("minimum report interval: %d (seconds?)\n", aimutil_get16(command->data+10));
1608 debug_print(debug_buff);
1609 } else 1590 } else
1610 debug_print("NULL minimum report interval!\n"); 1591 debug_printf("NULL minimum report interval!\n");
1611 return 1; 1592 return 1;
1612 } 1593 }
1613 1594
1614 int gaim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1595 int gaim_parse_buddyrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1615 va_list ap; 1596 va_list ap;
1618 va_start(ap, command); 1599 va_start(ap, command);
1619 maxbuddies = (u_short)va_arg(ap, u_int); 1600 maxbuddies = (u_short)va_arg(ap, u_int);
1620 maxwatchers = (u_short)va_arg(ap, u_int); 1601 maxwatchers = (u_short)va_arg(ap, u_int);
1621 va_end(ap); 1602 va_end(ap);
1622 1603
1623 sprintf(debug_buff, "buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers); 1604 debug_printf("buddy list rights: Max buddies = %d / Max watchers = %d\n", maxbuddies, maxwatchers);
1624 debug_print(debug_buff);
1625 1605
1626 return 1; 1606 return 1;
1627 } 1607 }
1628 1608
1629 int gaim_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) { 1609 int gaim_bosrights(struct aim_session_t *sess, struct command_rx_struct *command, ...) {
1633 va_start(ap, command); 1613 va_start(ap, command);
1634 maxpermits = (u_short)va_arg(ap, u_int); 1614 maxpermits = (u_short)va_arg(ap, u_int);
1635 maxdenies = (u_short)va_arg(ap, u_int); 1615 maxdenies = (u_short)va_arg(ap, u_int);
1636 va_end(ap); 1616 va_end(ap);
1637 1617
1638 sprintf(debug_buff, "BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies); 1618 debug_printf("BOS rights: Max permit = %d / Max deny = %d\n", maxpermits, maxdenies);
1639 debug_print(debug_buff);
1640 1619
1641 aim_bos_clientready(sess, command->conn); 1620 aim_bos_clientready(sess, command->conn);
1642 1621
1643 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV); 1622 aim_bos_reqservice(sess, command->conn, AIM_CONN_TYPE_CHATNAV);
1644 1623
1744 } 1723 }
1745 1724
1746 static void oscar_join_chat(struct gaim_connection *g, int exchange, char *name) { 1725 static void oscar_join_chat(struct gaim_connection *g, int exchange, char *name) {
1747 struct oscar_data *odata = (struct oscar_data *)g->proto_data; 1726 struct oscar_data *odata = (struct oscar_data *)g->proto_data;
1748 struct aim_conn_t *cur = NULL; 1727 struct aim_conn_t *cur = NULL;
1749 sprintf(debug_buff, "Attempting to join chat room %s.\n", name); 1728 debug_printf("Attempting to join chat room %s.\n", name);
1750 debug_print(debug_buff);
1751 if ((cur = aim_getconn_type(odata->sess, AIM_CONN_TYPE_CHATNAV))) { 1729 if ((cur = aim_getconn_type(odata->sess, AIM_CONN_TYPE_CHATNAV))) {
1752 debug_print("chatnav exists, creating room\n"); 1730 debug_printf("chatnav exists, creating room\n");
1753 aim_chatnav_createroom(odata->sess, cur, name, exchange); 1731 aim_chatnav_createroom(odata->sess, cur, name, exchange);
1754 } else { 1732 } else {
1755 /* this gets tricky */ 1733 /* this gets tricky */
1756 debug_print("chatnav does not exist, opening chatnav\n"); 1734 debug_printf("chatnav does not exist, opening chatnav\n");
1757 odata->create_exchange = exchange; 1735 odata->create_exchange = exchange;
1758 odata->create_name = g_strdup(name); 1736 odata->create_name = g_strdup(name);
1759 aim_bos_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV); 1737 aim_bos_reqservice(odata->sess, odata->conn, AIM_CONN_TYPE_CHATNAV);
1760 } 1738 }
1761 } 1739 }
1797 } 1775 }
1798 1776
1799 if (!b) 1777 if (!b)
1800 return; 1778 return;
1801 1779
1802 sprintf(debug_buff, "Attempting to leave room %s (currently in %d rooms)\n", 1780 debug_printf("Attempting to leave room %s (currently in %d rooms)\n", b->name, count);
1803 b->name, count);
1804 debug_print(debug_buff);
1805 1781
1806 c = find_oscar_chat(g, b->id); 1782 c = find_oscar_chat(g, b->id);
1807 if (c != NULL) { 1783 if (c != NULL) {
1808 if (odata) 1784 if (odata)
1809 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c); 1785 odata->oscar_chats = g_slist_remove(odata->oscar_chats, c);
2055 GtkWidget *vbox; 2031 GtkWidget *vbox;
2056 GtkWidget *hbox; 2032 GtkWidget *hbox;
2057 GtkWidget *label; 2033 GtkWidget *label;
2058 GtkWidget *entry; 2034 GtkWidget *entry;
2059 2035
2060 vbox = gtk_vbox_new(FALSE, 0); 2036 vbox = gtk_vbox_new(FALSE, 5);
2037 gtk_container_set_border_width(GTK_CONTAINER(vbox), 5);
2061 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox, 2038 gtk_notebook_append_page(GTK_NOTEBOOK(book), vbox,
2062 gtk_label_new("OSCAR Options")); 2039 gtk_label_new("OSCAR Options"));
2063 gtk_widget_show(vbox); 2040 gtk_widget_show(vbox);
2064 2041
2065 hbox = gtk_hbox_new(FALSE, 0); 2042 hbox = gtk_hbox_new(FALSE, 5);
2066 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); 2043 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
2067 gtk_widget_show(hbox); 2044 gtk_widget_show(hbox);
2068 2045
2069 label = gtk_label_new("Authorizer:"); 2046 label = gtk_label_new("Authorizer:");
2070 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 2047 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2071 gtk_widget_show(label); 2048 gtk_widget_show(label);
2072 2049
2073 entry = gtk_entry_new(); 2050 entry = gtk_entry_new();
2074 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); 2051 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
2075 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH); 2052 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_AUTH);
2076 gtk_signal_connect(GTK_OBJECT(entry), "changed", 2053 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2077 GTK_SIGNAL_FUNC(oscar_print_option), user); 2054 GTK_SIGNAL_FUNC(oscar_print_option), user);
2078 if (user->proto_opt[USEROPT_AUTH][0]) { 2055 if (user->proto_opt[USEROPT_AUTH][0]) {
2079 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]); 2056 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTH]);
2080 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTH]); 2057 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTH]);
2081 } else 2058 } else
2082 gtk_entry_set_text(GTK_ENTRY(entry), "login.oscar.aol.com"); 2059 gtk_entry_set_text(GTK_ENTRY(entry), "login.oscar.aol.com");
2083 gtk_widget_show(entry); 2060 gtk_widget_show(entry);
2084 2061
2085 hbox = gtk_hbox_new(FALSE, 0); 2062 hbox = gtk_hbox_new(FALSE, 5);
2086 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); 2063 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
2087 gtk_widget_show(hbox); 2064 gtk_widget_show(hbox);
2088 2065
2089 label = gtk_label_new("Authorizer Port:"); 2066 label = gtk_label_new("Authorizer Port:");
2090 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 2067 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2091 gtk_widget_show(label); 2068 gtk_widget_show(label);
2092 2069
2093 entry = gtk_entry_new(); 2070 entry = gtk_entry_new();
2094 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); 2071 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
2095 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1); 2072 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)1);
2096 gtk_signal_connect(GTK_OBJECT(entry), "changed", 2073 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2097 GTK_SIGNAL_FUNC(oscar_print_option), user); 2074 GTK_SIGNAL_FUNC(oscar_print_option), user);
2098 if (user->proto_opt[USEROPT_AUTHPORT][0]) { 2075 if (user->proto_opt[USEROPT_AUTHPORT][0]) {
2099 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]); 2076 debug_printf("setting text %s\n", user->proto_opt[USEROPT_AUTHPORT]);
2100 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]); 2077 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_AUTHPORT]);
2101 } else 2078 } else
2102 gtk_entry_set_text(GTK_ENTRY(entry), "5190"); 2079 gtk_entry_set_text(GTK_ENTRY(entry), "5190");
2103 gtk_widget_show(entry); 2080 gtk_widget_show(entry);
2104 2081
2105 hbox = gtk_hbox_new(FALSE, 0); 2082 hbox = gtk_hbox_new(FALSE, 5);
2106 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); 2083 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
2107 gtk_widget_show(hbox); 2084 gtk_widget_show(hbox);
2108 2085
2109 label = gtk_label_new("SOCKS5 Host:"); 2086 label = gtk_label_new("SOCKS5 Host:");
2110 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 2087 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2111 gtk_widget_show(label); 2088 gtk_widget_show(label);
2112 2089
2113 entry = gtk_entry_new(); 2090 entry = gtk_entry_new();
2114 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); 2091 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
2115 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST); 2092 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSHOST);
2116 gtk_signal_connect(GTK_OBJECT(entry), "changed", 2093 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2117 GTK_SIGNAL_FUNC(oscar_print_option), user); 2094 GTK_SIGNAL_FUNC(oscar_print_option), user);
2118 if (user->proto_opt[USEROPT_SOCKSHOST][0]) { 2095 if (user->proto_opt[USEROPT_SOCKSHOST][0]) {
2119 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]); 2096 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSHOST]);
2120 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSHOST]); 2097 gtk_entry_set_text(GTK_ENTRY(entry), user->proto_opt[USEROPT_SOCKSHOST]);
2121 } 2098 }
2122 gtk_widget_show(entry); 2099 gtk_widget_show(entry);
2123 2100
2124 hbox = gtk_hbox_new(FALSE, 0); 2101 hbox = gtk_hbox_new(FALSE, 5);
2125 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 5); 2102 gtk_box_pack_start(GTK_BOX(vbox), hbox, FALSE, FALSE, 0);
2126 gtk_widget_show(hbox); 2103 gtk_widget_show(hbox);
2127 2104
2128 label = gtk_label_new("SOCKS5 Port:"); 2105 label = gtk_label_new("SOCKS5 Port:");
2129 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 5); 2106 gtk_box_pack_start(GTK_BOX(hbox), label, FALSE, FALSE, 0);
2130 gtk_widget_show(label); 2107 gtk_widget_show(label);
2131 2108
2132 entry = gtk_entry_new(); 2109 entry = gtk_entry_new();
2133 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 5); 2110 gtk_box_pack_end(GTK_BOX(hbox), entry, FALSE, FALSE, 0);
2134 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT); 2111 gtk_object_set_user_data(GTK_OBJECT(entry), (void *)USEROPT_SOCKSPORT);
2135 gtk_signal_connect(GTK_OBJECT(entry), "changed", 2112 gtk_signal_connect(GTK_OBJECT(entry), "changed",
2136 GTK_SIGNAL_FUNC(oscar_print_option), user); 2113 GTK_SIGNAL_FUNC(oscar_print_option), user);
2137 if (user->proto_opt[USEROPT_SOCKSPORT][0]) { 2114 if (user->proto_opt[USEROPT_SOCKSPORT][0]) {
2138 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]); 2115 debug_printf("setting text %s\n", user->proto_opt[USEROPT_SOCKSPORT]);