Changeset 69cb623 for protocols/oscar/oscar.c
- Timestamp:
- 2006-10-15T09:41:12Z (18 years ago)
- Branches:
- master
- Children:
- 2529faf
- Parents:
- 695e392 (diff), e97827b (diff)
Note: this is a merge changeset, the changes displayed below correspond to the merge itself.
Use the(diff)
links above to see all the changes relative to each parent. - File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
protocols/oscar/oscar.c
r695e392 r69cb623 356 356 } 357 357 358 static void oscar_login(struct aim_user *user) { 358 static void oscar_acc_init(account_t *acc) 359 { 360 set_t *s; 361 362 s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); 363 s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY; 364 365 if (isdigit(acc->user[0])) { 366 s = set_add( &acc->set, "web_aware", "false", set_eval_bool, acc ); 367 s->flags |= ACC_SET_OFFLINE_ONLY; 368 } 369 } 370 371 static void oscar_login(account_t *acc) { 359 372 aim_session_t *sess; 360 373 aim_conn_t *conn; 361 374 char buf[256]; 362 struct gaim_connection *gc = new_gaim_conn( user);375 struct gaim_connection *gc = new_gaim_conn(acc); 363 376 struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); 364 377 365 if (isdigit( *user->username)) {378 if (isdigit(acc->user[0])) { 366 379 odata->icq = TRUE; 367 380 /* This is odd but it's necessary for a proper do_import and do_export. 368 381 We don't do those anymore, but let's stick with it, just in case 369 it accidentally fixes something else too... */382 it accidentally fixes something else too... </bitlbee> */ 370 383 gc->password[8] = 0; 371 384 } else { … … 390 403 } 391 404 392 if (g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 && 393 g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) { 394 serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",user->proto_opt[USEROPT_AUTH]); 405 if (acc->server == NULL) { 406 hide_login_progress(gc, "No servername specified"); 407 signoff(gc); 408 return; 409 } 410 411 if (g_strcasecmp(acc->server, "login.icq.com") != 0 && 412 g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { 413 serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); 395 414 } 396 415 … … 402 421 403 422 conn->status |= AIM_CONN_STATUS_INPROGRESS; 404 conn->fd = proxy_connect(user->proto_opt[USEROPT_AUTH][0] ? 405 user->proto_opt[USEROPT_AUTH] : AIM_DEFAULT_LOGIN_SERVER, 406 user->proto_opt[USEROPT_AUTHPORT][0] ? 407 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, 408 oscar_login_connect, gc); 423 conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc); 409 424 if (conn->fd < 0) { 410 425 hide_login_progress(gc, _("Couldn't connect to host")); … … 485 500 struct aim_authresp_info *info; 486 501 int i; char *host; int port; 487 struct aim_user *user;488 502 aim_conn_t *bosconn; 489 503 490 504 struct gaim_connection *gc = sess->aux_data; 491 505 struct oscar_data *od = gc->proto_data; 492 user = gc->user; 493 port = user->proto_opt[USEROPT_AUTHPORT][0] ? 494 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, 506 port = AIM_LOGIN_PORT; 495 507 496 508 va_start(ap, fr); … … 871 883 struct aim_redirect_data *redir; 872 884 struct gaim_connection *gc = sess->aux_data; 873 struct aim_user *user = gc->user;874 885 aim_conn_t *tstconn; 875 886 int i; … … 877 888 int port; 878 889 879 port = user->proto_opt[USEROPT_AUTHPORT][0] ?880 atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT,881 882 890 va_start(ap, fr); 883 891 redir = va_arg(ap, struct aim_redirect_data *); 884 892 va_end(ap); 885 893 894 port = AIM_LOGIN_PORT; 886 895 for (i = 0; i < (int)strlen(redir->ip); i++) { 887 896 if (redir->ip[i] == ':') { … … 1242 1251 channel = va_arg(ap, int); 1243 1252 userinfo = va_arg(ap, aim_userinfo_t *); 1244 1245 if (set_getint(sess->aux_data, "debug")) {1246 serv_got_crap(sess->aux_data, "channel %i called", channel);1247 }1248 1253 1249 1254 switch (channel) { … … 1723 1728 odata->rights.maxsiglen = odata->rights.maxawaymsglen = (guint)maxsiglen; 1724 1729 1730 /* FIXME: It seems we're not really using this, and it broke now that 1731 struct aim_user is dead. 1725 1732 aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps); 1726 1733 */ 1734 1727 1735 return 1; 1728 1736 } … … 2656 2664 ret->away_states = oscar_away_states; 2657 2665 ret->login = oscar_login; 2666 ret->acc_init = oscar_acc_init; 2658 2667 ret->close = oscar_close; 2659 2668 ret->send_im = oscar_send_im; … … 2673 2682 ret->set_permit_deny = oscar_set_permit_deny; 2674 2683 ret->keepalive = oscar_keepalive; 2675 ret->cmp_buddynames = aim_sncmp;2676 2684 ret->get_status_string = oscar_get_status_string; 2677 2685 ret->send_typing = oscar_send_typing; 2686 2687 ret->handle_cmp = aim_sncmp; 2678 2688 2679 2689 register_protocol(ret);
Note: See TracChangeset
for help on using the changeset viewer.