]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
virtual: Do not store recent flags to virtual index
authorAki Tuomi <aki.tuomi@dovecot.fi>
Wed, 26 Jul 2017 10:35:36 +0000 (13:35 +0300)
committerVille Savolainen <ville.savolainen@dovecot.fi>
Thu, 10 Aug 2017 10:25:21 +0000 (13:25 +0300)
Setting the flag here would case unnecessary index update
to clear the flag later on.

src/plugins/virtual/virtual-sync.c

index e6a20cff8f29cf2e484a057a72259e3cbc7f2dc9..2e2a7e28764d7edbc88bae7a28224986a7c4975e 100644 (file)
@@ -78,7 +78,9 @@ static void virtual_sync_external_flags(struct virtual_sync_context *ctx,
 
        /* copy flags */
        flags = mail_get_flags(bbox->sync_mail);
-       mail_index_update_flags(ctx->trans, vseq, MODIFY_REPLACE, flags);
+
+       /* we don't need to keep recent flags here */
+       mail_index_update_flags(ctx->trans, vseq, MODIFY_REPLACE, flags & ~(MAIL_RECENT));
 
        /* copy keywords */
        kw_names = mail_get_keywords(bbox->sync_mail);