From 1850a1601438db594b963180e4e1f53e2496c530 Mon Sep 17 00:00:00 2001 From: Gary Johnson Date: Sat, 15 Nov 2008 19:36:57 -0800 Subject: [PATCH] Suppress several progress messages in batch mode --- ChangeLog | 9 +++++++++ curs_lib.c | 6 ++++++ mutt_socket.c | 13 ++++++++----- mutt_ssl_gnutls.c | 14 ++++++++------ smtp.c | 3 ++- 5 files changed, 33 insertions(+), 12 deletions(-) diff --git a/ChangeLog b/ChangeLog index 664c7d86..7ace8224 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,12 @@ +2008-11-11 11:41 -0800 Kyle Wheeler (53ffd34f4de3) + + * smtp.c: Use envfrom instead of recomputing it in mutt_smpt_send. + +2008-10-29 20:49 -0700 TAKAHASHI Tamotsu (c2439fc68cd6) + + * pager.c: Restart pager search from top if called twice. Do not + loop infinitely. Closes #3127. + 2008-10-30 01:02 +0100 Emanuele Giaquinta (6c58b678d360) * account.c: Remove unused variable in mutt_account_match and fix diff --git a/curs_lib.c b/curs_lib.c index 25d5aa68..b7ef169e 100644 --- a/curs_lib.c +++ b/curs_lib.c @@ -353,6 +353,9 @@ void mutt_progress_init (progress_t* progress, const char *msg, if (!progress) return; + if (option(OPTNOCURSES)) + return; + memset (progress, 0, sizeof (progress_t)); progress->inc = inc; progress->flags = flags; @@ -390,6 +393,9 @@ void mutt_progress_update (progress_t* progress, long pos, int percent) struct timeval tv = { 0, 0 }; unsigned int now = 0; + if (option(OPTNOCURSES)) + return; + if (!progress->inc) goto out; diff --git a/mutt_socket.c b/mutt_socket.c index e5655d76..195e67de 100644 --- a/mutt_socket.c +++ b/mutt_socket.c @@ -474,8 +474,8 @@ int raw_socket_open (CONNECTION* conn) host_idna = conn->account.host; # endif - mutt_message (_("Looking up %s..."), conn->account.host); - + if (!option(OPTNOCURSES)) + mutt_message (_("Looking up %s..."), conn->account.host); rc = getaddrinfo (host_idna, port, &hints, &res); @@ -490,7 +490,8 @@ int raw_socket_open (CONNECTION* conn) return -1; } - mutt_message (_("Connecting to %s..."), conn->account.host); + if (!option(OPTNOCURSES)) + mutt_message (_("Connecting to %s..."), conn->account.host); rc = -1; for (cur = res; cur != NULL; cur = cur->ai_next) @@ -532,7 +533,8 @@ int raw_socket_open (CONNECTION* conn) host_idna = conn->account.host; # endif - mutt_message (_("Looking up %s..."), conn->account.host); + if (!option(OPTNOCURSES)) + mutt_message (_("Looking up %s..."), conn->account.host); he = gethostbyname (host_idna); @@ -546,7 +548,8 @@ int raw_socket_open (CONNECTION* conn) return -1; } - mutt_message (_("Connecting to %s..."), conn->account.host); + if (!option(OPTNOCURSES)) + mutt_message (_("Connecting to %s..."), conn->account.host); rc = -1; for (i = 0; he->h_addr_list[i] != NULL; i++) diff --git a/mutt_ssl_gnutls.c b/mutt_ssl_gnutls.c index 805be288..c8ca75dc 100644 --- a/mutt_ssl_gnutls.c +++ b/mutt_ssl_gnutls.c @@ -336,12 +336,14 @@ static int tls_negotiate (CONNECTION * conn) tls_get_client_cert (conn); - mutt_message (_("SSL/TLS connection using %s (%s/%s/%s)"), - gnutls_protocol_get_name (gnutls_protocol_get_version (data->state)), - gnutls_kx_get_name (gnutls_kx_get (data->state)), - gnutls_cipher_get_name (gnutls_cipher_get (data->state)), - gnutls_mac_get_name (gnutls_mac_get (data->state))); - mutt_sleep (0); + if (!option(OPTNOCURSES)) { + mutt_message (_("SSL/TLS connection using %s (%s/%s/%s)"), + gnutls_protocol_get_name (gnutls_protocol_get_version (data->state)), + gnutls_kx_get_name (gnutls_kx_get (data->state)), + gnutls_cipher_get_name (gnutls_cipher_get (data->state)), + gnutls_mac_get_name (gnutls_mac_get (data->state))); + mutt_sleep (0); + } return 0; diff --git a/smtp.c b/smtp.c index 2450c919..0dae118b 100644 --- a/smtp.c +++ b/smtp.c @@ -496,7 +496,8 @@ static int smtp_auth_sasl (CONNECTION* conn, const char* mechlist) return SMTP_AUTH_UNAVAIL; } - mutt_message (_("Authenticating (%s)..."), mech); + if (!option(OPTNOCURSES)) + mutt_message (_("Authenticating (%s)..."), mech); snprintf (buf, sizeof (buf), "AUTH %s", mech); if (len) -- 2.40.0