From 075421945c823aecac239d07d44ae8286cfe8793 Mon Sep 17 00:00:00 2001 From: Thomas Roessler Date: Tue, 9 May 2000 15:21:46 +0000 Subject: [PATCH] Make pop_delete a quad-option. From Honza Pazdziora . --- init.h | 2 +- pop.c | 9 ++++++--- 2 files changed, 7 insertions(+), 4 deletions(-) diff --git a/init.h b/init.h index 0466e14a..061650cf 100644 --- a/init.h +++ b/init.h @@ -1398,7 +1398,7 @@ struct option_t MuttVars[] = { ** messages to an external Unix command. */ #ifdef USE_POP - { "pop_delete", DT_BOOL, R_NONE, OPTPOPDELETE, 0 }, + { "pop_delete", DT_QUAD, R_NONE, OPTPOPDELETE, M_ASKNO }, /* ** .pp ** If set, Mutt will delete successfully downloaded messages from the POP diff --git a/pop.c b/pop.c index 14fa2a21..d6310445 100644 --- a/pop.c +++ b/pop.c @@ -82,7 +82,7 @@ void mutt_fetchPopMail (void) struct hostent *he; char buffer[2048]; char msgbuf[SHORT_STRING]; - int s, i, last = 0, msgs, bytes, err = 0; + int s, i, delanswer, last = 0, msgs, bytes, err = 0; CONTEXT ctx; MESSAGE *msg = NULL; @@ -204,7 +204,10 @@ void mutt_fetchPopMail (void) /* ignore an error here and assume all messages are new */ last = 0; } - + + if (msgs - last) + delanswer = query_quadoption(OPTPOPDELETE, _("Delete messages from server?")); + snprintf (msgbuf, sizeof (msgbuf), msgs > 1 ? _("Reading new messages (%d bytes)...") : _("Reading new message (%d bytes)..."), bytes); @@ -287,7 +290,7 @@ void mutt_fetchPopMail (void) if (err) break; - if (option (OPTPOPDELETE)) + if (delanswer == M_YES) { /* delete the message on the server */ snprintf (buffer, sizeof(buffer), "dele %d\r\n", i); -- 2.40.0