talons

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

commit c1297b2d44b2c9f516f12dd59a5f6d58ad91c9fc
parent 9b429ff5fdc20dba974ee6df92f6ac922861a3da
Author: Paul <paul@claws-mail.org>
Date:   Thu,  8 Nov 2018 18:42:43 +0000

fix check for mail at start-up

Diffstat:
Msrc/inc.c | 8++++----
Msrc/inc.h | 2++
Msrc/main.c | 7+++++--
Msrc/toolbar.c | 2+-
4 files changed, 12 insertions(+), 7 deletions(-)

diff --git a/src/inc.c b/src/inc.c @@ -413,7 +413,7 @@ void inc_account_list_mail(MainWindow *mainwin, GList *account_list, gboolean au } void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck, - gboolean notify) + gboolean check_at_startup, gboolean notify) { GList *list, *list2 = NULL; gboolean condition; @@ -431,11 +431,11 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck, /* Set up condition which decides whether or not to check * this account, based on whether we're doing global autocheck - * or a manual 'Get all' check. */ + * or a check at startup or a manual 'Get all' check. */ if (autocheck) condition = prefs_common_get_prefs()->autochk_newmail && account->autochk_use_default; - else + else if (check_at_startup || (!check_at_startup && !autocheck)) condition = account->recv_at_getall; if (condition) { @@ -1540,7 +1540,7 @@ static gint inc_autocheck_func(gpointer data) return FALSE; } - inc_all_account_mail(mainwin, TRUE, prefs_common.newmail_notify_auto); + inc_all_account_mail(mainwin, TRUE, FALSE, prefs_common.newmail_notify_auto); inc_autocheck_timer_set(); return FALSE; diff --git a/src/inc.h b/src/inc.h @@ -93,11 +93,13 @@ void inc_account_list_mail (MainWindow *mainwin, gboolean notify); /* This function is used by the global autocheck interval (autocheck TRUE), + * or check at startup (check_at_startup TRUE) * or by the manual 'Receive all' feature (autocheck FALSE). It makes * sure correct list of accounts is marked for checking, based on * global and account configuration, and calls inc_account_list_mail(). */ void inc_all_account_mail (MainWindow *mainwin, gboolean autocheck, + gboolean check_at_startup, gboolean notify); void inc_progress_update (Pop3Session *session); diff --git a/src/main.c b/src/main.c @@ -317,10 +317,13 @@ static gboolean defer_check_all(void *data) { gboolean autochk = GPOINTER_TO_INT(data); - inc_all_account_mail(static_mainwindow, autochk, + inc_all_account_mail(static_mainwindow, autochk, FALSE, prefs_common.newmail_notify_manu); if (sc_starting) { + inc_all_account_mail(static_mainwindow, FALSE, + prefs_common.chk_on_startup, + prefs_common.newmail_notify_manu); sc_starting = FALSE; main_window_set_menu_sensitive(static_mainwindow); toolbar_main_set_sensitive(static_mainwindow); @@ -2544,7 +2547,7 @@ static void lock_socket_input_cb(gpointer data, } else if (!strncmp(buf, "get_display", 11)) { fd_write_all(sock, x_display, strlen(x_display)); } else if (!strncmp(buf, "receive_all", 11)) { - inc_all_account_mail(mainwin, FALSE, + inc_all_account_mail(mainwin, FALSE, FALSE, prefs_common.newmail_notify_manu); } else if (!strncmp(buf, "receive", 7)) { inc_mail(mainwin, prefs_common.newmail_notify_manu); diff --git a/src/toolbar.c b/src/toolbar.c @@ -3018,7 +3018,7 @@ void inc_all_account_mail_cb(gpointer data, guint action, GtkWidget *widget) { MainWindow *mainwin = (MainWindow*)data; - inc_all_account_mail(mainwin, FALSE, prefs_common.newmail_notify_manu); + inc_all_account_mail(mainwin, FALSE, FALSE, prefs_common.newmail_notify_manu); } void send_queue_cb(gpointer data, guint action, GtkWidget *widget)