]> granicus.if.org Git - neomutt/commitdiff
Mark IMAP fast-trash'ed messages as read before copying. (see #3860)
authorKevin McCarthy <kevin@8t8.us>
Thu, 6 Oct 2016 19:35:38 +0000 (12:35 -0700)
committerRichard Russon <rich@flatcap.org>
Sun, 9 Oct 2016 10:39:08 +0000 (11:39 +0100)
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

index f560161726ce5b7d785968494e3cc0ebcf7e6595..e65d5312e584a6a95e731f357d3c376189203eb0 100644 (file)
@@ -2117,6 +2117,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)
     {