]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
fts: storage - Remove no longer needed virtual handlings
authorMarco Bettini <marco.bettini@open-xchange.com>
Thu, 27 Jul 2023 08:45:05 +0000 (08:45 +0000)
committerMarco Bettini <marco.bettini@open-xchange.com>
Tue, 10 Oct 2023 07:13:49 +0000 (07:13 +0000)
src/plugins/fts/fts-storage.c

index feb714faaf9e43dd48defbf7f239ec52f236dad4..f2d91fced73365a6d5952fcb2eed7ff3af7ebe2a 100644 (file)
@@ -507,6 +507,7 @@ static int fts_mail_index(struct mail *_mail)
        struct fts_mailbox_list *flist = FTS_LIST_CONTEXT_REQUIRE(_mail->box->list);
        struct mail_private *pmail = (struct mail_private *)_mail;
 
+       i_assert(pmail->vmail == NULL);
        if (ft->failure_reason != NULL)
                return -1;
 
@@ -514,27 +515,6 @@ static int fts_mail_index(struct mail *_mail)
                if (fts_mail_precache_init(_mail) < 0)
                        return -1;
        }
-       if (pmail->vmail != NULL) {
-               /* Indexing via virtual mailbox: Index all the mails in this
-                  same real mailbox. */
-               uint32_t msgs_count =
-                       mail_index_view_get_messages_count(_mail->box->view);
-
-               fts_backend_update_set_mailbox(flist->update_ctx, _mail->box);
-               if (ft->next_index_seq > msgs_count) {
-                       /* everything indexed already */
-                       return 0;
-               } else if (fts_mail_precache_range(_mail->transaction,
-                                                  flist->update_ctx,
-                                                  ft->next_index_seq,
-                                                  msgs_count,
-                                                  &ft->precache_extra_count) < 0) {
-                       return -1;
-               } else {
-                       ft->next_index_seq = msgs_count+1;
-                       return 0;
-               }
-       }
 
        if (ft->next_index_seq < _mail->seq) {
                /* we'll first need to index all the missing mails up to the
@@ -565,11 +545,9 @@ static int fts_mail_precache(struct mail *_mail)
        struct fts_transaction_context *ft = FTS_CONTEXT_REQUIRE(_mail->transaction);
        int ret = 0;
 
+       i_assert(!fmail->virtual_mail);
        fmail->module_ctx.super.precache(_mail);
-       if (fmail->virtual_mail) {
-               if (ft->highest_virtual_uid < _mail->uid)
-                       ft->highest_virtual_uid = _mail->uid;
-       } else if (!ft->indexing) T_BEGIN {
+       if (!ft->indexing) T_BEGIN {
                /* avoid recursing here from fts_mail_precache_range() */
                struct event_reason *reason =
                        event_reason_begin("fts:index");