From b74b4fc75da43afc4f77f58534e241cb6e20edd3 Mon Sep 17 00:00:00 2001 From: Kevin McCarthy Date: Thu, 6 Oct 2016 12:35:38 -0700 Subject: [PATCH] Mark IMAP fast-trash'ed messages as read before copying. (see #3860) Regular copying/saving messages in mutt via a UID COPY first calls imap_sync_message(). However that function is designed to sync all flags (including deleted), and so isn't useful for the fast-trash code. As an easier solution, instead add a UID STORE to set \\Seen for the same msgset as the trashed messages. --- imap/imap.c | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/imap/imap.c b/imap/imap.c index 2e3d27d3d..729284dba 100644 --- a/imap/imap.c +++ b/imap/imap.c @@ -2116,6 +2116,14 @@ int imap_fast_trash (CONTEXT* ctx, char* dest) /* loop in case of TRYCREATE */ do { + rc = imap_exec_msgset (idata, "UID STORE", "+FLAGS.SILENT (\\Seen)", + MUTT_TRASH, 0, 0); + if (rc < 0) + { + dprint (1, (debugfile, "imap_fast_trash: Unable to mark messages as seen\n")); + goto out; + } + rc = imap_exec_msgset (idata, "UID COPY", mmbox, MUTT_TRASH, 0, 0); if (!rc) { -- 2.50.1