aboutsummaryrefslogtreecommitdiff
path: root/src/inc.c
diff options
context:
space:
mode:
authorhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-14 06:59:29 +0000
committerhiro <hiro@ee746299-78ed-0310-b773-934348b2243d>2005-12-14 06:59:29 +0000
commit6e466a9e0cf75cf6e4a512fcdb793766f0c45a63 (patch)
tree78e513f9e9b3288162adf452835d693434fcec5d /src/inc.c
parent53d03c4970876ad8387fb3a743a25f4b9cec85e3 (diff)
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
Diffstat (limited to 'src/inc.c')
-rw-r--r--src/inc.c41
1 files changed, 27 insertions, 14 deletions
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 */