summaryrefslogtreecommitdiffstats
path: root/flags.c
diff options
context:
space:
mode:
authorThomas Roessler <roessler@does-not-exist.org>2000-12-21 09:19:41 +0000
committerThomas Roessler <roessler@does-not-exist.org>2000-12-21 09:19:41 +0000
commit99c394e8cd4d2079b5b8d6ca001336dd9974ac75 (patch)
tree6dc5e1187a0210feba9b2eb7a7a75b647449a4e2 /flags.c
parentc19d6fb7a430519ed01c04e9d40513304559497a (diff)
patch.me.maildir_trash.1
Diffstat (limited to 'flags.c')
-rw-r--r--flags.c22
1 files changed, 22 insertions, 0 deletions
diff --git a/flags.c b/flags.c
index 879e739c..60ae4c7e 100644
--- a/flags.c
+++ b/flags.c
@@ -38,6 +38,17 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
if (!h->deleted)
{
h->deleted = 1;
+ if (ctx->magic == M_MAILDIR && option(OPTMAILDIRTRASH))
+ {
+ /* As with the IMAP comment below, we need to mark the
+ * message and mailbox as changed, because deleting a message
+ * just changes its status on disk without actually deleting
+ * it. Without this, the 'T' flag would never get set when
+ * the maildir box is synched.
+ */
+ h->changed = 1;
+ if (upd_ctx) ctx->changed = 1;
+ }
if (upd_ctx) ctx->deleted++;
#ifdef USE_IMAP
/* deleted messages aren't treated as changed elsewhere so that the
@@ -54,6 +65,17 @@ void _mutt_set_flag (CONTEXT *ctx, HEADER *h, int flag, int bf, int upd_ctx)
{
h->deleted = 0;
if (upd_ctx) ctx->deleted--;
+ if (ctx->magic == M_MAILDIR && option(OPTMAILDIRTRASH))
+ {
+ /* As with the IMAP comment below, we need to mark the
+ * message and mailbox as changed, because deleting a message
+ * just changes its status on disk without actually deleting
+ * it. Without this, the 'T' flag would never get set when
+ * the maildir box is synched.
+ */
+ h->changed = 1;
+ if (upd_ctx) ctx->changed = 1;
+ }
#ifdef USE_IMAP
/* see my comment above */
if (ctx->magic == M_IMAP)