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: neomutt-20170225~32^2~105 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=b74b4fc75da43afc4f77f58534e241cb6e20edd3;p=neomutt 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 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) {