<<< Date Index >>>     <<< Thread Index >>>

[PATCH] message counting vs unset mark_old



Cleaning out some entries from RH bugzilla:

Original patch from Richard Henderson: (<rth@xxxxxxxxxx>)
...
Description of problem:

I have to use "unset mark_old" with IMAP, due to the fact that
the IMAP server considers the message new iff it has never been
touched in any way by any MUA.  I want to consider the message
new if I have never read the message, nor have I re-marked it new.

This works ok, but there are minor buglets in mutt's message
counting when "unset mark_old" is in effect.

Version-Release number of selected component (if applicable):

mutt-1.4-4

...

Patch applies to 1.5.6 as well.

Bill
--- mx.c.orig   Tue Aug  6 10:47:05 2002
+++ mx.c        Tue Aug  6 10:47:47 2002
@@ -1076,7 +1076,7 @@
       if (!ctx->hdrs[j]->read)
       { 
        ctx->unread++;
-       if (!ctx->hdrs[j]->old)
+       if (!ctx->hdrs[j]->old || !option(OPTMARKOLD))
          ctx->new++;
       } 
 
--- imap/imap.c.markold Sun Apr  7 14:19:14 2002
+++ imap/imap.c Tue Aug  6 14:34:06 2002
@@ -1140,7 +1140,6 @@
 
 /* returns count of recent messages if new = 1, else count of total messages.
  * (useful for at least postponed function)
- * Question of taste: use RECENT or UNSEEN for new?
  *   0+   number of messages in mailbox
  *  -1    error while polling mailboxes
  */
@@ -1191,7 +1190,7 @@
           mutt_bit_isset(idata->capabilities,STATUS))
   {                            
     snprintf (buf, sizeof (buf), "STATUS %s (%s)", mbox,
-      new ? "RECENT" : "MESSAGES");
+      new ? (option(OPTMARKOLD) ? "RECENT" : "UNSEEN") : "MESSAGES");
   }
   else
     /* Server does not support STATUS, and this is not the current mailbox.