Changeset View
Changeset View
Standalone View
Standalone View
mail/mutt/files/extra-patch-maildir-mtime
--- PATCHES.orig 2017-06-03 22:37:15 UTC | --- PATCHES.orig 2017-09-04 15:19:31.167205000 -0400 | ||||
+++ PATCHES | +++ PATCHES 2017-09-04 15:19:31.168636000 -0400 | ||||
@@ -0,0 +1 @@ | @@ -0,0 +1 @@ | ||||
+patch-1.5.7.ust.maildir-mtime.2 | +patch-1.5.7.ust.maildir-mtime.2 | ||||
--- browser.c.orig 2017-06-03 22:37:03 UTC | --- browser.c.orig 2017-09-04 15:19:27.714342000 -0400 | ||||
+++ browser.c | +++ browser.c 2017-09-04 15:19:31.178678000 -0400 | ||||
@@ -32,6 +32,7 @@ | @@ -32,6 +32,7 @@ | ||||
#ifdef USE_IMAP | #ifdef USE_IMAP | ||||
#include "imap.h" | #include "imap.h" | ||||
#endif | #endif | ||||
+#include "mx.h" | +#include "mx.h" | ||||
#include <stdlib.h> | #include <stdlib.h> | ||||
#include <dirent.h> | #include <dirent.h> | ||||
@@ -413,6 +414,21 @@ static void init_state (struct browser_s | @@ -413,6 +414,21 @@ | ||||
menu->data = state->entry; | menu->data = state->entry; | ||||
} | } | ||||
+static void check_maildir_times (BUFFY *buf, struct stat *st) | +static void check_maildir_times (BUFFY *buf, struct stat *st) | ||||
+{ | +{ | ||||
+ char buffer[_POSIX_PATH_MAX + SHORT_STRING]; | + char buffer[_POSIX_PATH_MAX + SHORT_STRING]; | ||||
+ struct stat s; | + struct stat s; | ||||
+ | + | ||||
+ if(!buf || buf->magic != MUTT_MAILDIR) | + if(!buf || buf->magic != MUTT_MAILDIR) | ||||
+ return; | + return; | ||||
+ | + | ||||
+ snprintf (buffer, sizeof (buffer), "%s/tmp", buf->path); | + snprintf (buffer, sizeof (buffer), "%s/tmp", buf->path); | ||||
+ if (lstat (buffer, &s) != 0) | + if (lstat (buffer, &s) != 0) | ||||
+ return; | + return; | ||||
+ | + | ||||
+ st->st_mtime = s.st_mtime; | + st->st_mtime = s.st_mtime; | ||||
+} | +} | ||||
+ | + | ||||
static int examine_directory (MUTTMENU *menu, struct browser_state *state, | static int examine_directory (MUTTMENU *menu, struct browser_state *state, | ||||
char *d, const char *prefix) | char *d, const char *prefix) | ||||
{ | { | ||||
@@ -476,6 +492,7 @@ static int examine_directory (MUTTMENU * | @@ -476,6 +492,7 @@ | ||||
tmp = Incoming; | tmp = Incoming; | ||||
while (tmp && mutt_strcmp (buffer, tmp->path)) | while (tmp && mutt_strcmp (buffer, tmp->path)) | ||||
tmp = tmp->next; | tmp = tmp->next; | ||||
+ check_maildir_times (tmp, &s); | + check_maildir_times (tmp, &s); | ||||
if (tmp && Context && | if (tmp && Context && | ||||
!mutt_strcmp (tmp->realpath, Context->realpath)) | !mutt_strcmp (tmp->realpath, Context->realpath)) | ||||
{ | { | ||||
@@ -549,6 +566,7 @@ static int examine_mailboxes (MUTTMENU * | @@ -549,6 +566,7 @@ | ||||
strfcpy (buffer, NONULL(tmp->path), sizeof (buffer)); | s.st_mtime = st2.st_mtime; | ||||
mutt_pretty_mailbox (buffer, sizeof (buffer)); | } | ||||
+ check_maildir_times (tmp, &s); | + check_maildir_times (tmp, &s); | ||||
add_folder (menu, state, buffer, &s, tmp); | add_folder (menu, state, buffer, &s, tmp); | ||||
} | } | ||||
while ((tmp = tmp->next)); | while ((tmp = tmp->next)); |