From: Markus Valentin Date: Thu, 27 Jan 2022 07:06:16 +0000 (+0100) Subject: imapc: imapc_untagged_fetch_update_flags() - Reduce indentation X-Git-Tag: 2.4.0~4591 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=3c4a2b34dae2c1f94d1b64a9b4f78ec21322db37;p=thirdparty%2Fdovecot%2Fcore.git imapc: imapc_untagged_fetch_update_flags() - Reduce indentation --- diff --git a/src/lib-storage/index/imapc/imapc-mailbox.c b/src/lib-storage/index/imapc/imapc-mailbox.c index 0111eb7fb8..89cd535c3d 100644 --- a/src/lib-storage/index/imapc/imapc-mailbox.c +++ b/src/lib-storage/index/imapc/imapc-mailbox.c @@ -499,39 +499,39 @@ imapc_untagged_fetch_update_flags(struct imapc_mailbox *mbox, struct imapc_untagged_fetch_ctx *ctx, uint32_t lseq) { + ARRAY_TYPE(keyword_indexes) old_kws; + struct mail_keywords *kw; const struct mail_index_record *rec = NULL; const char *atom; + if (!ctx->have_flags) + return; + rec = mail_index_lookup(mbox->delayed_sync_view, lseq); - if (ctx->have_flags && rec->flags != ctx->flags) { + if (rec->flags != ctx->flags) { mail_index_update_flags(mbox->delayed_sync_trans, lseq, MODIFY_REPLACE, ctx->flags); } - if (ctx->have_flags) { - ARRAY_TYPE(keyword_indexes) old_kws; - struct mail_keywords *kw; - t_array_init(&old_kws, 8); - mail_index_lookup_keywords(mbox->delayed_sync_view, lseq, - &old_kws); + t_array_init(&old_kws, 8); + mail_index_lookup_keywords(mbox->delayed_sync_view, lseq, &old_kws); - if (ctx->have_gmail_labels) { - /* add keyword for mails that have GMail labels. - this can be used for "All Mail" mailbox migrations - with dsync */ - atom = "$GMailHaveLabels"; - array_push_back(&ctx->keywords, &atom); - } + if (ctx->have_gmail_labels) { + /* add keyword for mails that have GMail labels. + this can be used for "All Mail" mailbox migrations + with dsync */ + atom = "$GMailHaveLabels"; + array_push_back(&ctx->keywords, &atom); + } - array_append_zero(&ctx->keywords); - kw = mail_index_keywords_create(mbox->box.index, - array_front(&ctx->keywords)); - if (!keywords_are_equal(kw, &old_kws)) { - mail_index_update_keywords(mbox->delayed_sync_trans, - lseq, MODIFY_REPLACE, kw); - } - mail_index_keywords_unref(&kw); + array_append_zero(&ctx->keywords); + kw = mail_index_keywords_create(mbox->box.index, + array_front(&ctx->keywords)); + if (!keywords_are_equal(kw, &old_kws)) { + mail_index_update_keywords(mbox->delayed_sync_trans, + lseq, MODIFY_REPLACE, kw); } + mail_index_keywords_unref(&kw); } static void imapc_untagged_fetch_handle(struct imapc_mailbox *mbox,