diff options
Diffstat (limited to 'protocols/oscar')
-rw-r--r-- | protocols/oscar/oscar.c | 56 |
1 files changed, 36 insertions, 20 deletions
diff --git a/protocols/oscar/oscar.c b/protocols/oscar/oscar.c index 1118c26d..e0c32257 100644 --- a/protocols/oscar/oscar.c +++ b/protocols/oscar/oscar.c @@ -372,13 +372,19 @@ static void oscar_init(account_t *acc) { set_t *s; - s = set_add( &acc->set, "server", AIM_DEFAULT_LOGIN_SERVER, set_eval_account, acc ); + if (isdigit(acc->user[0])) { + set_add(&acc->set, "ignore_auth_requests", "false", set_eval_bool, acc); + } + + s = set_add(&acc->set, "server", AIM_DEFAULT_LOGIN_SERVER, 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 ); + if(isdigit(acc->user[0])) { + s = set_add(&acc->set, "web_aware", "false", set_eval_bool, acc); s->flags |= ACC_SET_OFFLINE_ONLY; } + + acc->flags |= ACC_FLAG_AWAY_MESSAGE; } static void oscar_login(account_t *acc) { @@ -1209,10 +1215,15 @@ static void gaim_icq_authdeny(void *data_) { * For when other people ask you for authorization */ static void gaim_icq_authask(struct im_connection *ic, guint32 uin, char *msg) { - struct icq_auth *data = g_new(struct icq_auth, 1); + struct icq_auth *data; char *reason = NULL; char *dialog_msg; + + if (set_getbool(&ic->acc->set, "ignore_auth_requests")) + return; + data = g_new(struct icq_auth, 1); + if (strlen(msg) > 6) reason = msg + 6; @@ -1951,6 +1962,8 @@ static void oscar_get_away(struct im_connection *g, char *who) { static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, const char *state, const char *message) { + if (state == NULL) + state = ""; if (!g_strcasecmp(state, _("Visible"))) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); @@ -1958,7 +1971,9 @@ static void oscar_set_away_aim(struct im_connection *ic, struct oscar_data *od, } else if (!g_strcasecmp(state, _("Invisible"))) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); return; - } /* else... */ + } else if (message == NULL) { + message = state; + } if (od->rights.maxawaymsglen == 0) imcb_error(ic, "oscar_set_away_aim called before locate rights received"); @@ -2001,7 +2016,7 @@ static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, no_message = TRUE; } - if (!g_strcasecmp(state, "Online")) { + if (state == NULL) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); } else if (!g_strcasecmp(state, "Away")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_AWAY); @@ -2026,7 +2041,7 @@ static void oscar_set_away_icq(struct im_connection *ic, struct oscar_data *od, } else if (!g_strcasecmp(state, "Invisible")) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_INVISIBLE); ic->away = g_strdup(msg); - } else if (!g_strcasecmp(state, GAIM_AWAY_CUSTOM)) { + } else { if (no_message) { aim_setextstatus(od->sess, od->conn, AIM_ICQ_STATE_NORMAL); } else { @@ -2275,20 +2290,21 @@ static void oscar_rem_deny(struct im_connection *ic, char *who) { static GList *oscar_away_states(struct im_connection *ic) { struct oscar_data *od = ic->proto_data; - GList *m = NULL; - - if (!od->icq) - return g_list_append(m, GAIM_AWAY_CUSTOM); - - m = g_list_append(m, "Online"); - m = g_list_append(m, "Away"); - m = g_list_append(m, "Do Not Disturb"); - m = g_list_append(m, "Not Available"); - m = g_list_append(m, "Occupied"); - m = g_list_append(m, "Free For Chat"); - m = g_list_append(m, "Invisible"); - return m; + if (od->icq) { + static GList *m = NULL; + m = g_list_append(m, "Away"); + m = g_list_append(m, "Do Not Disturb"); + m = g_list_append(m, "Not Available"); + m = g_list_append(m, "Occupied"); + m = g_list_append(m, "Free For Chat"); + m = g_list_append(m, "Invisible"); + return m; + } else { + static GList *m = NULL; + m = g_list_append(m, "Away"); + return m; + } } static int gaim_icqinfo(aim_session_t *sess, aim_frame_t *fr, ...) |