]> granicus.if.org Git - mutt/commitdiff
Make pop_delete a quad-option. From Honza Pazdziora
authorThomas Roessler <roessler@does-not-exist.org>
Tue, 9 May 2000 15:21:46 +0000 (15:21 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Tue, 9 May 2000 15:21:46 +0000 (15:21 +0000)
<adelton@informatics.muni.cz>.

init.h
pop.c

diff --git a/init.h b/init.h
index 0466e14a6eb12e345cec79f5449f66f026e1fdf1..061650cf7b9b0217152d47b7c7094b75ee1d836f 100644 (file)
--- 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 14fa2a2118bb910f2492c17ab94bc711590d178a..d63104454699ae5db2e0836165052b6d84954779 100644 (file)
--- 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);