From 421db132e5c38ae0a128814b76dd8aceaae39144 Mon Sep 17 00:00:00 2001 From: Rocco Rutte Date: Wed, 10 Jun 2009 17:44:14 +0200 Subject: [PATCH] Only print messages about CONTEXT when quiet flag not set --- mbox.c | 6 ++++-- mx.c | 36 ++++++++++++++++++++++++------------ 2 files changed, 28 insertions(+), 14 deletions(-) diff --git a/mbox.c b/mbox.c index db2cda639..36d496c80 100644 --- a/mbox.c +++ b/mbox.c @@ -935,7 +935,8 @@ int mbox_sync_mailbox (CONTEXT *ctx, int *index_hint) /* copy the temp mailbox back into place starting at the first * change/deleted message */ - mutt_message _("Committing changes..."); + if (!ctx->quiet) + mutt_message _("Committing changes..."); i = mutt_copy_stream (fp, ctx->fp); if (ferror (ctx->fp)) @@ -1065,7 +1066,8 @@ int mutt_reopen_mailbox (CONTEXT *ctx, int *index_hint) /* silent operations */ ctx->quiet = 1; - mutt_message _("Reopening mailbox..."); + if (!ctx->quiet) + mutt_message _("Reopening mailbox..."); /* our heuristics require the old mailbox to be unsorted */ if (Sort != SORT_ORDER) diff --git a/mx.c b/mx.c index 4ed9eb1c8..7c7c73a2c 100644 --- a/mx.c +++ b/mx.c @@ -865,7 +865,8 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) if (move_messages) { - mutt_message (_("Moving read messages to %s..."), mbox); + if (!ctx->quiet) + mutt_message (_("Moving read messages to %s..."), mbox); #ifdef USE_IMAP /* try to use server-side copy first */ @@ -924,7 +925,8 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) } else if (!ctx->changed && ctx->deleted == 0) { - mutt_message _("Mailbox is unchanged."); + if (!ctx->quiet) + mutt_message _("Mailbox is unchanged."); mx_fastclose_mailbox (ctx); return 0; } @@ -959,12 +961,15 @@ int mx_close_mailbox (CONTEXT *ctx, int *index_hint) } } - if (move_messages) - mutt_message (_("%d kept, %d moved, %d deleted."), - ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted); - else - mutt_message (_("%d kept, %d deleted."), - ctx->msgcount - ctx->deleted, ctx->deleted); + if (!ctx->quiet) + { + if (move_messages) + mutt_message (_("%d kept, %d moved, %d deleted."), + ctx->msgcount - ctx->deleted, read_msgs, ctx->deleted); + else + mutt_message (_("%d kept, %d deleted."), + ctx->msgcount - ctx->deleted, ctx->deleted); + } if (ctx->msgcount == ctx->deleted && (ctx->magic == M_MMDF || ctx->magic == M_MBOX) && @@ -1088,7 +1093,8 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint) if (!ctx->changed && !ctx->deleted) { - mutt_message _("Mailbox is unchanged."); + if (!ctx->quiet) + mutt_message _("Mailbox is unchanged."); return (0); } @@ -1134,11 +1140,17 @@ int mx_sync_mailbox (CONTEXT *ctx, int *index_hint) { #ifdef USE_IMAP if (ctx->magic == M_IMAP && !purge) - mutt_message _("Mailbox checkpointed."); + { + if (!ctx->quiet) + mutt_message _("Mailbox checkpointed."); + } else #endif - mutt_message (_("%d kept, %d deleted."), msgcount - deleted, - deleted); + { + if (!ctx->quiet) + mutt_message (_("%d kept, %d deleted."), msgcount - deleted, + deleted); + } mutt_sleep (0); -- 2.40.0