talons

Fork of Claws Mail https://www.claws-mail
Log | Files | Refs | README | LICENSE

commit 358e811283ebfd8c377dd2ef94876f4e52e67606
parent 3b5b4f75ddf190346e4e8a1ee4521f32cafd0a37
Author: Andrej Kacian <ticho@claws-mail.org>
Date:   Fri, 15 Jul 2016 11:56:22 +0200

Remove obsolete A_APOP and A_RPOP account protocols.

CLAWS_CONFIG_VERSION bumped to 1.

Diffstat:
Msrc/inc.c | 1-
Msrc/prefs_account.c | 6------
Msrc/prefs_account.h | 2--
Msrc/prefs_common.h | 2+-
Msrc/prefs_migration.c | 30++++++++++++++++++++++++++++++
Msrc/send_message.c | 2+-
6 files changed, 32 insertions(+), 11 deletions(-)

diff --git a/src/inc.c b/src/inc.c @@ -257,7 +257,6 @@ static gint inc_account_mail_real(MainWindow *mainwin, PrefsAccount *account) folderview_check_new(FOLDER(account->folder)); return 0; case A_POP3: - case A_APOP: session = inc_session_new(account); if (!session) return 0; diff --git a/src/prefs_account.c b/src/prefs_account.c @@ -3557,12 +3557,6 @@ void prefs_account_read_config(PrefsAccount *ac_prefs, const gchar *label) if (id < 0) g_warning("wrong account id: %d", id); ac_prefs->account_id = id; - if (ac_prefs->protocol == A_APOP) { - debug_print("converting protocol A_APOP to new prefs.\n"); - ac_prefs->protocol = A_POP3; - ac_prefs->use_apop_auth = TRUE; - } - if (privacy_prefs != NULL) { strv = g_strsplit(privacy_prefs, ",", 0); for (cur = strv; *cur != NULL; cur++) { diff --git a/src/prefs_account.h b/src/prefs_account.h @@ -28,8 +28,6 @@ typedef struct _PrefsAccount PrefsAccount; typedef enum { A_POP3, - A_APOP, /* deprecated */ - A_RPOP, /* deprecated */ A_IMAP4, A_NNTP, A_LOCAL, diff --git a/src/prefs_common.h b/src/prefs_common.h @@ -36,7 +36,7 @@ #include "prefs_msg_colors.h" #include "prefs_summary_open.h" -#define CLAWS_CONFIG_VERSION 0 +#define CLAWS_CONFIG_VERSION 1 typedef struct _PrefsCommon PrefsCommon; diff --git a/src/prefs_migration.c b/src/prefs_migration.c @@ -22,12 +22,42 @@ #include "claws-features.h" #endif +#include "account.h" +#include "prefs_account.h" #include "prefs_common.h" static void _update_config(gint version) { + GList *cur; + PrefsAccount *ac_prefs; + + debug_print("Updating config version %d to %d.\n", version, version + 1); + switch (version) { case 0: + + /* Removing A_APOP and A_RPOP from RecvProtocol enum, + * protocol numbers above A_POP3 need to be adjusted. + * + * In config_version=0: + * A_POP3 is 0, + * A_APOP is 1, + * A_RPOP is 2, + * A_IMAP and the rest are from 3 up. + * We can't use the macros, since they may change in the + * future. Numbers do not change. :) */ + for (cur = account_get_list(); cur != NULL; cur = cur->next) { + ac_prefs = (PrefsAccount *)cur->data; + if (ac_prefs->protocol == 1) { + ac_prefs->protocol = 0; + } else if (ac_prefs->protocol > 2) { + /* A_IMAP and above gets bumped down by 2. */ + ac_prefs->protocol -= 2; + } + } + + break; + default: break; } diff --git a/src/send_message.c b/src/send_message.c @@ -350,7 +350,7 @@ gint send_message_smtp_full(PrefsAccount *ac_prefs, GSList *to_list, FILE *fp, g _("Connecting")); if (ac_prefs->pop_before_smtp - && (ac_prefs->protocol == A_APOP || ac_prefs->protocol == A_POP3) + && (ac_prefs->protocol == A_POP3) && (time(NULL) - ac_prefs->last_pop_login_time) > (60 * ac_prefs->pop_before_smtp_timeout)) { g_snprintf(buf, sizeof(buf), _("Doing POP before SMTP...")); log_message(LOG_PROTOCOL, "%s\n", buf);