From 0a3c243b6659dc10efb227e507f324c2711d6dcd Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sat, 1 Jul 2006 01:18:56 +0200 Subject: Got rid of struct aim_user (now using account_t everywhere). Needs some more testing though. --- protocols/oscar/oscar.c | 35 ++++++++++++++--------------------- 1 file changed, 14 insertions(+), 21 deletions(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 7c76533a..d55ce3f2 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -355,18 +355,18 @@ static gboolean oscar_login_connect(gpointer data, gint source, b_input_conditio return FALSE; } -static void oscar_login(struct aim_user *user) { +static void oscar_login(account_t *acc) { aim_session_t *sess; aim_conn_t *conn; char buf[256]; - struct gaim_connection *gc = new_gaim_conn(user); + struct gaim_connection *gc = new_gaim_conn(acc); struct oscar_data *odata = gc->proto_data = g_new0(struct oscar_data, 1); - if (isdigit(*user->username)) { + if (isdigit(acc->user[0])) { odata->icq = TRUE; /* This is odd but it's necessary for a proper do_import and do_export. We don't do those anymore, but let's stick with it, just in case - it accidentally fixes something else too... */ + it accidentally fixes something else too... */ gc->password[8] = 0; } else { gc->flags |= OPT_CONN_HTML; @@ -389,9 +389,9 @@ static void oscar_login(struct aim_user *user) { return; } - if (g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.icq.com") != 0 && - g_strcasecmp(user->proto_opt[USEROPT_AUTH], "login.oscar.aol.com") != 0) { - serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",user->proto_opt[USEROPT_AUTH]); + if (g_strcasecmp(acc->server, "login.icq.com") != 0 && + g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { + serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); } g_snprintf(buf, sizeof(buf), _("Signon: %s"), gc->username); @@ -401,11 +401,7 @@ static void oscar_login(struct aim_user *user) { aim_conn_addhandler(sess, conn, 0x0017, 0x0003, gaim_parse_auth_resp, 0); conn->status |= AIM_CONN_STATUS_INPROGRESS; - conn->fd = proxy_connect(user->proto_opt[USEROPT_AUTH][0] ? - user->proto_opt[USEROPT_AUTH] : AIM_DEFAULT_LOGIN_SERVER, - user->proto_opt[USEROPT_AUTHPORT][0] ? - atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, - oscar_login_connect, gc); + conn->fd = proxy_connect(acc->server, AIM_LOGIN_PORT, oscar_login_connect, gc); if (conn->fd < 0) { hide_login_progress(gc, _("Couldn't connect to host")); signoff(gc); @@ -484,14 +480,11 @@ static int gaim_parse_auth_resp(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; struct aim_authresp_info *info; int i; char *host; int port; - struct aim_user *user; aim_conn_t *bosconn; struct gaim_connection *gc = sess->aux_data; struct oscar_data *od = gc->proto_data; - user = gc->user; - port = user->proto_opt[USEROPT_AUTHPORT][0] ? - atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, + port = AIM_LOGIN_PORT; va_start(ap, fr); info = va_arg(ap, struct aim_authresp_info *); @@ -870,19 +863,16 @@ static int gaim_handle_redirect(aim_session_t *sess, aim_frame_t *fr, ...) { va_list ap; struct aim_redirect_data *redir; struct gaim_connection *gc = sess->aux_data; - struct aim_user *user = gc->user; aim_conn_t *tstconn; int i; char *host; int port; - port = user->proto_opt[USEROPT_AUTHPORT][0] ? - atoi(user->proto_opt[USEROPT_AUTHPORT]) : AIM_LOGIN_PORT, - va_start(ap, fr); redir = va_arg(ap, struct aim_redirect_data *); va_end(ap); + port = AIM_LOGIN_PORT; for (i = 0; i < (int)strlen(redir->ip); i++) { if (redir->ip[i] == ':') { port = atoi(&(redir->ip[i+1])); @@ -1722,8 +1712,11 @@ static int gaim_parse_locaterights(aim_session_t *sess, aim_frame_t *fr, ...) odata->rights.maxsiglen = odata->rights.maxawaymsglen = (guint)maxsiglen; + /* FIXME: It seems we're not really using this, and it broke now that + struct aim_user is dead. aim_bos_setprofile(sess, fr->conn, gc->user->user_info, NULL, gaim_caps); - + */ + return 1; } -- cgit v1.2.3 From 96863f65118767e968469e82ba6b02006e36b81c Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 2 Jul 2006 11:49:31 +0200 Subject: Added protocol-specific settings, made the server setting specific to only OSCAR and Jabber. --- protocols/oscar/oscar.c | 15 +++++++++++++++ 1 file changed, 15 insertions(+) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index d55ce3f2..28239812 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -355,6 +355,14 @@ static gboolean oscar_login_connect(gpointer data, gint source, b_input_conditio return FALSE; } +static void oscar_acc_init(account_t *acc) +{ + set_t *s; + + s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); + s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY; +} + static void oscar_login(account_t *acc) { aim_session_t *sess; aim_conn_t *conn; @@ -389,6 +397,12 @@ static void oscar_login(account_t *acc) { return; } + if (acc->server == NULL) { + hide_login_progress(gc, "No servername specified"); + signoff(gc); + return; + } + if (g_strcasecmp(acc->server, "login.icq.com") != 0 && g_strcasecmp(acc->server, "login.oscar.aol.com") != 0) { serv_got_crap(gc, "Warning: Unknown OSCAR server: `%s'. Please review your configuration if the connection fails.",acc->server); @@ -2648,6 +2662,7 @@ void oscar_init() ret->name = "oscar"; ret->away_states = oscar_away_states; ret->login = oscar_login; + ret->acc_init = oscar_acc_init; ret->close = oscar_close; ret->send_im = oscar_send_im; ret->get_info = oscar_get_info; -- cgit v1.2.3 From 5b52a4895e5a59ff6509f7771f4d8665737688c3 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Mon, 3 Jul 2006 23:22:45 +0200 Subject: Implemented per-account nick lists instead of per-protocol nick lists. nick_t is dead, instead nicks are just saves in a per-account_t GLib hash table. While doing this, the import_buddies command finally died and text_save() disappeared, because the old file format can't handle most of the new features in this branch anyway. Still have to implement support for the new nick lists in text_load()! --- protocols/oscar/oscar.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 28239812..f65332dc 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -2680,9 +2680,10 @@ void oscar_init() ret->rem_deny = oscar_rem_deny; ret->set_permit_deny = oscar_set_permit_deny; ret->keepalive = oscar_keepalive; - ret->cmp_buddynames = aim_sncmp; ret->get_status_string = oscar_get_status_string; ret->send_typing = oscar_send_typing; + + ret->handle_cmp = aim_sncmp; register_protocol(ret); } -- cgit v1.2.3 From d3a672c0b70eb7b50dcd2908d6cd6928d4f7d874 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Fri, 4 Aug 2006 15:56:53 +0200 Subject: Added a per-account web_aware setting for ICQ connections. --- protocols/oscar/oscar.c | 5 +++++ protocols/oscar/service.c | 4 ++++ 2 files changed, 9 insertions(+) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index f65332dc..d30ebbe8 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -361,6 +361,11 @@ static void oscar_acc_init(account_t *acc) s = set_add( &acc->set, "server", NULL, set_eval_account, acc ); s->flags |= ACC_SET_NOSAVE | ACC_SET_OFFLINE_ONLY; + + if (isdigit(acc->user[0])) { + s = set_add( &acc->set, "web_aware", "false", set_eval_bool, acc ); + s->flags |= ACC_SET_OFFLINE_ONLY; + } } static void oscar_login(account_t *acc) { diff --git a/protocols/oscar/service.c b/protocols/oscar/service.c index 4596974f..d55e0987 100644 --- a/protocols/oscar/service.c +++ b/protocols/oscar/service.c @@ -731,8 +731,12 @@ int aim_setextstatus(aim_session_t *sess, aim_conn_t *conn, guint32 status) aim_tlvlist_t *tl = NULL; guint32 data; int tlvlen; + struct gaim_connection *gc = sess ? sess->aux_data : NULL; data = AIM_ICQ_STATE_HIDEIP | status; /* yay for error checking ;^) */ + + if (gc && set_getbool(&gc->acc->set, "web_aware")) + data |= AIM_ICQ_STATE_WEBAWARE; tlvlen = aim_addtlvtochain32(&tl, 0x0006, data); -- cgit v1.2.3 From d5ccd83c5235528df2481003502647b86b41fdc4 Mon Sep 17 00:00:00 2001 From: Wilmer van der Gaast Date: Sun, 13 Aug 2006 21:15:23 +0200 Subject: Extra comments in set.h and now properly using set_getbool() instead of set_getint(). --- protocols/oscar/oscar.c | 4 ---- protocols/oscar/rxhandlers.c | 4 ---- 2 files changed, 8 deletions(-) (limited to 'protocols/oscar') diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index d30ebbe8..b8cf521b 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -1251,10 +1251,6 @@ static int gaim_parse_incoming_im(aim_session_t *sess, aim_frame_t *fr, ...) { channel = va_arg(ap, int); userinfo = va_arg(ap, aim_userinfo_t *); - if (set_getint(sess->aux_data, "debug")) { - serv_got_crap(sess->aux_data, "channel %i called", channel); - } - switch (channel) { case 1: { /* standard message */ struct aim_incomingim_ch1_args *args; diff --git a/protocols/oscar/rxhandlers.c b/protocols/oscar/rxhandlers.c index be8aba44..7014e693 100644 --- a/protocols/oscar/rxhandlers.c +++ b/protocols/oscar/rxhandlers.c @@ -112,10 +112,6 @@ static int consumesnac(aim_session_t *sess, aim_frame_t *rx) /* Following SNAC will be related */ } - if (set_getint(sess->aux_data, "debug")) { - serv_got_crap(sess->aux_data, "snac %x/%x received", snac.family, snac.subtype); - } - for (cur = (aim_module_t *)sess->modlistv; cur; cur = cur->next) { if (!(cur->flags & AIM_MODFLAG_MULTIFAMILY) && -- cgit v1.2.3