On Tue, Jan 31, 2012 at 06:28:32PM -0800, Michael Elkins wrote:
> On Wed, Feb 01, 2012 at 02:28:53AM +0100, Linus Lüssing wrote:
> >Hi again,
> >
> >Actually no, it does not seem to work, also for non-flat
> >layouts... the new mails count does not stay at 0 after a
> >restart of mutt. Don't know what I saw before.
> >
> >This mail thread from 5 years ago sounds similar:
> >http://does-not-exist.org/mail-archives/mutt-dev/msg07456.html
> >
> >Was this issue supposed to be fixed with any version between
> >1.5.13 and 1.5.21?
> 
> Yes, you may way to try 1.5.21.  The new mail detection code was
> cleaned up to make all the mailbox formats more uniform.
> 

Hi Michael,

Hmm, I tried 1.5.21 and also latest HEAD from the repository,
but I'm still having the same issue. With some 'hg bisect'ing I'm
having the same results as Bob 5 years ago, the behaviour changed
from 3837:26e3c34c9e66 on, "New new mail detection code. Now we use
UIDVALIDITY/UIDNEXT to detect whether" from Brendan Cully.

Reverting back to before this commit makes the new mail count in
the mailbox view stay at 0 after restarting mutt.


For the second issue, the missing 'N' flag in the browser view,
the following, attached patch seems to work for me, but I don't know
whether this is the way to go (I'm not that familiar with the IMAP
intenals). And after applying this patch, still the first issue
with mutt restarts remains, for both the browser and mailbox view.


Cheers, Linus
# HG changeset patch
# User [email protected]
# Date 1328134484 -3600
# Branch HEAD
# Node ID fcd688cdbe6f521580a41965b14becbef3959f54
# Parent  c26dbc7021f4ec56c0e41d43019e43dd0be666de
RFC: Display New flag in browser view for IMAP

The new mail count is always set to 0 when changing
to the browser view in the case of IMAP due to new
folder states being created.

With this patch a STATUS request is sent to the
IMAP server for all subscribed folders when changing
to the browser view, too, not only when changing to the
mailbox view.

diff --git a/imap/browse.c b/imap/browse.c
--- a/imap/browse.c
+++ b/imap/browse.c
@@ -392,6 +392,14 @@
   return rc == IMAP_CMD_OK ? 0 : -1;
 }
 
+int imap_folder_get_new (char *path) {
+  struct mailbox_state mbox;
+
+  imap_mailbox_state (path, &mbox);
+
+  return mbox.new;
+}
+
 /* imap_add_folder: add a folder name to the browser list, formatting it as
  *   necessary. */
 static void imap_add_folder (char delim, char *folder, int noselect,
@@ -451,6 +459,7 @@
   (state->entry)[state->entrylen].delim = delim;
   (state->entry)[state->entrylen].selectable = !noselect;
   (state->entry)[state->entrylen].inferiors = !noinferiors;
+  (state->entry)[state->entrylen].new = imap_folder_get_new(tmp);
   (state->entrylen)++;
 
   FREE (&mx.mbox);
diff --git a/imap/util.c b/imap/util.c
--- a/imap/util.c
+++ b/imap/util.c
@@ -604,7 +604,7 @@
   mutt_account_tourl (&mx->account, &url);
   url.path = path;
 
-  url_ciss_tostring (&url, dest, len, 0);
+  url_ciss_tostring (&url, dest, len, U_DECODE_PASSWD);
 }
 
 

Reply via email to