]> granicus.if.org Git - neomutt/commitdiff
Do not set old flag if mark_old is false 651/head
authorManos Pitsidianakis <el13635@mail.ntua.gr>
Sun, 25 Jun 2017 12:56:44 +0000 (15:56 +0300)
committerRichard Russon <rich@flatcap.org>
Wed, 28 Jun 2017 14:19:56 +0000 (15:19 +0100)
If `mark_old` is false, unread mails will not be marked old after
they've been viewed. But they will be marked old if found in the `/cur`
subdirectory of the Maildir. This is inconsistent behaviour, since a
user with disabled `mark_old` will expect no old flags at all.

imap/message.c
mh.c
parse.c

index 8887ccc8d8f1112c737f7bdc6c958cb35208d9c1..367f95936f10d38c2468af64e00437a994006b66 100644 (file)
@@ -182,7 +182,7 @@ static char *msg_parse_flags(struct ImapHeader *h, char *s)
     else if (ascii_strncasecmp("old", s, 3) == 0)
     {
       s += 3;
-      hd->old = true;
+      hd->old = option(OPTMARKOLD) ? true : false;
     }
     else
     {
diff --git a/mh.c b/mh.c
index c048724cc8f3e7f32136ad545bf5d41a8c5fccd0..b04842e22eff439245b3a810c559292416923f15 100644 (file)
--- a/mh.c
+++ b/mh.c
@@ -805,7 +805,7 @@ static int maildir_parse_dir(struct Context *ctx, struct Maildir ***last,
   if (subdir)
   {
     snprintf(buf, sizeof(buf), "%s/%s", ctx->path, subdir);
-    is_old = (mutt_strcmp("cur", subdir) == 0);
+    is_old = option(OPTMARKOLD) ? (mutt_strcmp("cur", subdir) == 0) : false;
   }
   else
     strfcpy(buf, ctx->path, sizeof(buf));
diff --git a/parse.c b/parse.c
index b55e8e8c948bd3a8e2c4e1bcaf3f56a1cfffb0fd..973117288d4661744a3b93bd31c5b42eda5fddee 100644 (file)
--- a/parse.c
+++ b/parse.c
@@ -1253,7 +1253,7 @@ int mutt_parse_rfc822_line(struct Envelope *e, struct Header *hdr, char *line,
                 hdr->replied = true;
                 break;
               case 'O':
-                hdr->old = true;
+                hdr->old = option(OPTMARKOLD) ? true: false;
                 break;
               case 'R':
                 hdr->read = true;