summaryrefslogtreecommitdiffstats
path: root/imap
diff options
context:
space:
mode:
authorKevin McCarthy <kevin@8t8.us>2020-03-01 14:20:39 -0800
committerKevin McCarthy <kevin@8t8.us>2020-03-01 14:20:39 -0800
commit1399257da6d925d7e627d250db2d465597466ef2 (patch)
treea8cea2d36f8e6b6d2c50b57d38aabe62270af628 /imap
parent14752ae2adb110624ad73bd4718d70275c2ae017 (diff)
Try to respect MUTT_QUIET for IMAP contexts too.
There are still connection related messages, but at least reduce the number of messages.
Diffstat (limited to 'imap')
-rw-r--r--imap/imap.c16
-rw-r--r--imap/message.c42
2 files changed, 35 insertions, 23 deletions
diff --git a/imap/imap.c b/imap/imap.c
index 0c38ec43..5e3502fc 100644
--- a/imap/imap.c
+++ b/imap/imap.c
@@ -665,7 +665,8 @@ static int imap_open_mailbox (CONTEXT* ctx)
idata->newMailCount = 0;
idata->max_msn = 0;
- mutt_message (_("Selecting %s..."), idata->mailbox);
+ if (!ctx->quiet)
+ mutt_message (_("Selecting %s..."), idata->mailbox);
imap_munge_mbox_name (idata, buf, sizeof(buf), idata->mailbox);
/* pipeline ACL test */
@@ -1327,7 +1328,8 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint)
for (n = 0; n < ctx->msgcount; n++)
if (ctx->hdrs[n]->deleted && ctx->hdrs[n]->changed)
ctx->hdrs[n]->active = 0;
- mutt_message (_("Marking %d messages deleted..."), quickdel_rc);
+ if (!ctx->quiet)
+ mutt_message (_("Marking %d messages deleted..."), quickdel_rc);
}
}
@@ -1383,8 +1385,9 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint)
#if USE_HCACHE
imap_hcache_close (idata);
#endif
- mutt_message (_("Saving changed messages... [%d/%d]"), n+1,
- ctx->msgcount);
+ if (!ctx->quiet)
+ mutt_message (_("Saving changed messages... [%d/%d]"), n+1,
+ ctx->msgcount);
if (!appendctx)
appendctx = mx_open_mailbox (ctx->path, MUTT_APPEND | MUTT_QUIET, NULL);
if (!appendctx)
@@ -1496,7 +1499,8 @@ int imap_sync_mailbox (CONTEXT* ctx, int expunge, int* index_hint)
if (expunge && !(ctx->closing) &&
mutt_bit_isset(ctx->rights, MUTT_ACL_DELETE))
{
- mutt_message _("Expunging messages from server...");
+ if (!ctx->quiet)
+ mutt_message _("Expunging messages from server...");
/* Set expunge bit so we don't get spurious reopened messages */
idata->reopen |= IMAP_EXPUNGE_EXPECTED;
if (imap_exec (idata, "EXPUNGE", 0) != 0)
@@ -2368,7 +2372,7 @@ int imap_fast_trash (CONTEXT* ctx, char* dest)
dprint (1, (debugfile, "could not queue copy\n"));
goto out;
}
- else
+ else if (!ctx->quiet)
mutt_message (_("Copying %d messages to %s..."), rc, mbox);
/* let's get it on */
diff --git a/imap/message.c b/imap/message.c
index fe148f97..56b44f05 100644
--- a/imap/message.c
+++ b/imap/message.c
@@ -421,10 +421,11 @@ static int read_headers_normal_eval_cache (IMAP_DATA *idata,
ctx = idata->ctx;
idx = ctx->msgcount;
- /* L10N:
- Comparing the cached data with the IMAP server's data */
- mutt_progress_init (&progress, _("Evaluating cache..."),
- MUTT_PROGRESS_MSG, ReadInc, msn_end);
+ if (!ctx->quiet)
+ /* L10N:
+ Comparing the cached data with the IMAP server's data */
+ mutt_progress_init (&progress, _("Evaluating cache..."),
+ MUTT_PROGRESS_MSG, ReadInc, msn_end);
/* If we are using CONDSTORE's "FETCH CHANGEDSINCE", then we keep
* the flags in the header cache, and update them further below.
@@ -441,7 +442,8 @@ static int read_headers_normal_eval_cache (IMAP_DATA *idata,
if (SigInt && query_abort_header_download (idata))
return -1;
- mutt_progress_update (&progress, msgno, -1);
+ if (!ctx->quiet)
+ mutt_progress_update (&progress, msgno, -1);
memset (&h, 0, sizeof (h));
h.data = safe_calloc (1, sizeof (IMAP_HEADER_DATA));
@@ -620,10 +622,11 @@ static int read_headers_condstore_qresync_updates (IMAP_DATA *idata,
ctx = idata->ctx;
- /* L10N:
- Fetching IMAP flag changes, using the CONDSTORE extension */
- mutt_progress_init (&progress, _("Fetching flag updates..."),
- MUTT_PROGRESS_MSG, ReadInc, msn_end);
+ if (!ctx->quiet)
+ /* L10N:
+ Fetching IMAP flag changes, using the CONDSTORE extension */
+ mutt_progress_init (&progress, _("Fetching flag updates..."),
+ MUTT_PROGRESS_MSG, ReadInc, msn_end);
snprintf (buf, sizeof (buf),
"UID FETCH 1:%u (FLAGS) (CHANGEDSINCE %llu%s)",
@@ -638,7 +641,8 @@ static int read_headers_condstore_qresync_updates (IMAP_DATA *idata,
if (SigInt && query_abort_header_download (idata))
return -1;
- mutt_progress_update (&progress, msgno, -1);
+ if (!ctx->quiet)
+ mutt_progress_update (&progress, msgno, -1);
/* cmd_parse_fetch will update the flags */
rc = imap_cmd_step (idata);
@@ -764,8 +768,9 @@ static int read_headers_fetch_new (IMAP_DATA *idata, unsigned int msn_begin,
unlink (mutt_b2s (tempfile));
mutt_buffer_pool_release (&tempfile);
- mutt_progress_init (&progress, _("Fetching message headers..."),
- MUTT_PROGRESS_MSG, ReadInc, msn_end);
+ if (!ctx->quiet)
+ mutt_progress_init (&progress, _("Fetching message headers..."),
+ MUTT_PROGRESS_MSG, ReadInc, msn_end);
b = mutt_buffer_pool_get ();
@@ -795,7 +800,8 @@ static int read_headers_fetch_new (IMAP_DATA *idata, unsigned int msn_begin,
query_abort_header_download (idata))
goto bail;
- mutt_progress_update (&progress, msgno, -1);
+ if (!ctx->quiet)
+ mutt_progress_update (&progress, msgno, -1);
rewind (fp);
memset (&h, 0, sizeof (h));
@@ -972,7 +978,7 @@ int imap_fetch_message (CONTEXT *ctx, MESSAGE *msg, int msgno)
/* This function is called in a few places after endwin()
* e.g. _mutt_pipe_message(). */
- output_progress = !isendwin ();
+ output_progress = !isendwin () && !ctx->quiet;
if (output_progress)
mutt_message _("Fetching message...");
@@ -1202,8 +1208,9 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
}
rewind (fp);
- mutt_progress_init (&progressbar, _("Uploading message..."),
- MUTT_PROGRESS_SIZE, NetInc, len);
+ if (!ctx->quiet)
+ mutt_progress_init (&progressbar, _("Uploading message..."),
+ MUTT_PROGRESS_SIZE, NetInc, len);
imap_munge_mbox_name (idata, mbox, sizeof (mbox), mailbox);
imap_make_date (internaldate, msg->received);
@@ -1244,7 +1251,8 @@ int imap_append_message (CONTEXT *ctx, MESSAGE *msg)
sent += len;
if (flush_buffer (buf, &len, idata->conn) < 0)
goto fail;
- mutt_progress_update (&progressbar, sent, -1);
+ if (!ctx->quiet)
+ mutt_progress_update (&progressbar, sent, -1);
}
}