sthen df4efa83a9 Update Mutt to 1.5.17, fix WANTLIB for 1.5.xx (adding qdbm in 1.5.16
brought in a dependency on libz).

feedback/ok bernd@, simon@
2007-11-11 10:09:43 +00:00

50 lines
1.4 KiB
Plaintext

$OpenBSD: patch-browser_c,v 1.5 2007/11/11 10:09:43 sthen Exp $
--- browser.c.orig Wed Sep 5 19:28:05 2007
+++ browser.c Fri Nov 2 08:17:06 2007
@@ -27,6 +27,7 @@
#include "buffy.h"
#include "mapping.h"
#include "sort.h"
+#include "mx.h"
#include "mailbox.h"
#include "browser.h"
#ifdef USE_IMAP
@@ -352,6 +353,21 @@ static void init_state (struct browser_state *state, M
menu->data = state->entry;
}
+static void check_maildir_times (BUFFY *buf, struct stat *st)
+{
+ char buffer[_POSIX_PATH_MAX + SHORT_STRING];
+ struct stat s;
+
+ if(!buf || buf->magic != M_MAILDIR)
+ return;
+
+ snprintf (buffer, sizeof (buffer), "%s/tmp", buf->path);
+ if (lstat (buffer, &s) != 0)
+ return;
+
+ st->st_mtime = s.st_mtime;
+}
+
static int examine_directory (MUTTMENU *menu, struct browser_state *state,
char *d, const char *prefix)
{
@@ -415,6 +431,7 @@ static int examine_directory (MUTTMENU *menu, struct b
tmp = Incoming;
while (tmp && mutt_strcmp (buffer, tmp->path))
tmp = tmp->next;
+ check_maildir_times (tmp, &s);
add_folder (menu, state, de->d_name, &s, (tmp) ? tmp->new : 0);
}
closedir (dp);
@@ -464,6 +481,7 @@ static int examine_mailboxes (MUTTMENU *menu, struct b
strfcpy (buffer, NONULL(tmp->path), sizeof (buffer));
mutt_pretty_mailbox (buffer);
+ check_maildir_times (tmp, &s);
add_folder (menu, state, buffer, &s, tmp->new);
}
while ((tmp = tmp->next));