From 6e466a9e0cf75cf6e4a512fcdb793766f0c45a63 Mon Sep 17 00:00:00 2001 From: hiro Date: Wed, 14 Dec 2005 06:59:29 +0000 Subject: added an option to update only INBOX on checking new messages of IMAP4 accounts. git-svn-id: svn://sylpheed.sraoss.jp/sylpheed/trunk@827 ee746299-78ed-0310-b773-934348b2243d --- src/inc.c | 41 +++++++++++++++++++++++++++-------------- 1 file changed, 27 insertions(+), 14 deletions(-) (limited to 'src/inc.c') diff --git a/src/inc.c b/src/inc.c index f03e2b72..4afbb25c 100644 --- a/src/inc.c +++ b/src/inc.c @@ -71,6 +71,9 @@ static GdkPixbuf *ok_pixbuf; static void inc_finished (MainWindow *mainwin, gint new_messages); + +static gint inc_remote_account_mail (MainWindow *mainwin, + PrefsAccount *account); static gint inc_account_mail_real (MainWindow *mainwin, PrefsAccount *account); @@ -231,21 +234,37 @@ void inc_mail(MainWindow *mainwin) inc_autocheck_timer_set(); } -static gint inc_account_mail_real(MainWindow *mainwin, PrefsAccount *account) +static gint inc_remote_account_mail(MainWindow *mainwin, PrefsAccount *account) { - IncProgressDialog *inc_dialog; - IncSession *session; + FolderItem *item = mainwin->summaryview->folder_item; - if (account->protocol == A_IMAP4 || account->protocol == A_NNTP) { - FolderItem *item = mainwin->summaryview->folder_item; + g_return_val_if_fail(account->folder != NULL, 0); + if (account->protocol == A_IMAP4 && account->imap_check_inbox_only) { + FolderItem *inbox = FOLDER(account->folder)->inbox; + + folderview_check_new_item(inbox); + if (!prefs_common.scan_all_after_inc && item != NULL && + inbox == item) + folderview_update_item(item, TRUE); + } else { folderview_check_new(FOLDER(account->folder)); if (!prefs_common.scan_all_after_inc && item != NULL && FOLDER(account->folder) == item->folder) folderview_update_item(item, TRUE); - return 1; } + return 1; +} + +static gint inc_account_mail_real(MainWindow *mainwin, PrefsAccount *account) +{ + IncProgressDialog *inc_dialog; + IncSession *session; + + if (account->protocol == A_IMAP4 || account->protocol == A_NNTP) + return inc_remote_account_mail(mainwin, account); + session = inc_session_new(account); if (!session) return 0; @@ -307,14 +326,8 @@ void inc_all_account_mail(MainWindow *mainwin, gboolean autocheck) for (list = account_get_list(); list != NULL; list = list->next) { PrefsAccount *account = list->data; if ((account->protocol == A_IMAP4 || - account->protocol == A_NNTP) && account->recv_at_getall) { - FolderItem *item = mainwin->summaryview->folder_item; - - folderview_check_new(FOLDER(account->folder)); - if (!prefs_common.scan_all_after_inc && item != NULL && - FOLDER(account->folder) == item->folder) - folderview_update_item(item, TRUE); - } + account->protocol == A_NNTP) && account->recv_at_getall) + inc_remote_account_mail(mainwin, account); } /* check POP3 accounts */ -- cgit v1.2.3