]> granicus.if.org Git - mutt/commitdiff
Avoid implicit flag updates with IMAP. From Brendan Cully.
authorThomas Roessler <roessler@does-not-exist.org>
Sun, 10 Dec 2000 21:01:30 +0000 (21:01 +0000)
committerThomas Roessler <roessler@does-not-exist.org>
Sun, 10 Dec 2000 21:01:30 +0000 (21:01 +0000)
imap/message.c
init.h
mutt.h

index 3a317fe1939c44d936c14049de8dffbaffa669f3..071b2e8dfa30604d4fa6b0785a9eb108a8ad44b2 100644 (file)
@@ -245,8 +245,11 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno)
     return -1;
   }
 
-  snprintf (buf, sizeof (buf), "UID FETCH %d RFC822",
-    HEADER_DATA(ctx->hdrs[msgno])->uid);
+  snprintf (buf, sizeof (buf), "UID FETCH %d %s",
+           HEADER_DATA(ctx->hdrs[msgno])->uid,
+           (mutt_bit_isset (idata->capabilities, IMAP4REV1) ?
+            (option (OPTIMAPPEEK) ? "BODY.PEEK[]" : "BODY[]") :
+            "RFC822"));
 
   imap_cmd_start (idata, buf);
   do
@@ -272,7 +275,8 @@ int imap_fetch_message (MESSAGE *msg, CONTEXT *ctx, int msgno)
          if (uid != HEADER_DATA(ctx->hdrs[msgno])->uid)
            mutt_error (_("The message index is incorrect. Try reopening the mailbox."));
        }
-       else if (strncasecmp ("RFC822", pc, 6) == 0)
+       else if ((strncasecmp ("RFC822", pc, 6) == 0) ||
+                (strncasecmp ("BODY[]", pc, 6) == 0))
        {
          pc = imap_next_word (pc);
          if (imap_get_literal_count(pc, &bytes) < 0)
diff --git a/init.h b/init.h
index e17e35fbc6a2c1ed6248df1f5fee54a88a5ece54..a121748bbba236e9738a32b05e6c557e2f77ab5e 100644 (file)
--- a/init.h
+++ b/init.h
@@ -704,6 +704,14 @@ struct option_t MuttVars[] = {
   ** user/password pairs on mutt invocation, or if opening the connection
   ** is slow.
   */
+  { "imap_peek", DT_BOOL, R_NONE, OPTIMAPPEEK, 1 },
+  /*
+  ** .pp
+  ** If set, mutt will avoid implicitly marking your mail as read whenever
+  ** you fetch a message from the server. This is generally a good thing,
+  ** but can make closing an IMAP folder somewhat slower. This option
+  ** exists to appease spead freaks.
+  */
   { "imap_servernoise",                DT_BOOL, R_NONE, OPTIMAPSERVERNOISE, 1 },
   /*
   ** .pp
diff --git a/mutt.h b/mutt.h
index e98a4c3855987b0949a187bba2c28d8abe3c45cc..e29e4a825b78ee89672937bcef27c87865e17fec 100644 (file)
--- a/mutt.h
+++ b/mutt.h
@@ -317,6 +317,7 @@ enum
 #ifdef USE_IMAP
   OPTIMAPLSUB,
   OPTIMAPPASSIVE,
+  OPTIMAPPEEK,
   OPTIMAPSERVERNOISE,
 # ifdef USE_SSL
   OPTIMAPFORCESSL,