From: Kevin McCarthy Date: Thu, 6 Oct 2016 19:35:38 +0000 (-0700) Subject: Mark IMAP fast-trash'ed messages as read before copying. (see #3860) X-Git-Tag: mutt-1-8-rel~126 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=22ee589741d58c929b2812a80a8d9dd61838a9f9;p=mutt 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. --- diff --git a/imap/imap.c b/imap/imap.c index 2e3d27d3..729284db 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) {