]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-index: Make mail_cache_field_can_add() allowing to add existing fields of type...
authorsergey.kitov <sergey.kitov@open-xchange.com>
Thu, 1 Sep 2022 08:06:08 +0000 (11:06 +0300)
committeraki.tuomi <aki.tuomi@open-xchange.com>
Wed, 21 Sep 2022 12:41:34 +0000 (12:41 +0000)
src/lib-index/mail-cache-transaction.c

index 0bf910e7c79a67ac1e6a0a19b13b21e66716eff2..098ef1514ae53e03cd71e8d9052f93f7ac4aef23 100644 (file)
@@ -918,6 +918,11 @@ bool mail_cache_field_can_add(struct mail_cache_transaction_ctx *ctx,
        if (decision == (MAIL_CACHE_DECISION_FORCED | MAIL_CACHE_DECISION_NO))
                return FALSE;
 
+       /* fields of bitmask type can be added multiple times */
+       const struct mail_cache_field *field = mail_cache_register_get_field(ctx->view->cache, field_idx);
+       if (field->type == MAIL_CACHE_FIELD_BITMASK)
+               return TRUE;
+
        return mail_cache_field_exists(ctx->view, seq, field_idx) == 0;
 }