changeset: 6808:323e3d6e5e4c
user:      Kevin McCarthy <[email protected]>
date:      Thu Oct 06 12:35:38 2016 -0700
link:      http://dev.mutt.org/hg/mutt/rev/323e3d6e5e4c

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.

diffs (18 lines):

diff -r 227211e0e84c -r 323e3d6e5e4c imap/imap.c
--- a/imap/imap.c       Wed Oct 05 15:04:57 2016 -0700
+++ b/imap/imap.c       Thu Oct 06 12:35:38 2016 -0700
@@ -2116,6 +2116,14 @@
   /* 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)
     {

Reply via email to