]> git.ipfire.org Git - thirdparty/dovecot/core.git/commitdiff
lib-storage: index_list_open_view() - Rename status_check to require_refreshed
authorTimo Sirainen <timo.sirainen@open-xchange.com>
Tue, 9 Jul 2019 14:11:16 +0000 (17:11 +0300)
committerTimo Sirainen <timo.sirainen@open-xchange.com>
Wed, 10 Jul 2019 06:48:24 +0000 (06:48 +0000)
This describes the parameter's behavior better.

src/lib-storage/list/mailbox-list-index-status.c

index 88f74161ae28dc1d64ae9c77103ae9aa2052ca07..659e0a80e8552643965c81e9b7908dc7a1d9dd7e 100644 (file)
@@ -28,7 +28,7 @@ struct index_list_storage_module index_list_storage_module =
        MODULE_CONTEXT_INIT(&mail_storage_module_register);
 
 static int
-index_list_open_view(struct mailbox *box, bool status_check,
+index_list_open_view(struct mailbox *box, bool require_refreshed,
                     struct mail_index_view **view_r, uint32_t *seq_r)
 {
        struct mailbox_list_index *ilist = INDEX_LIST_CONTEXT_REQUIRE(box->list);
@@ -37,8 +37,12 @@ index_list_open_view(struct mailbox *box, bool status_check,
        uint32_t seq;
        int ret;
 
-       if (MAILBOX_IS_NEVER_IN_INDEX(box) && status_check)
+       if (MAILBOX_IS_NEVER_IN_INDEX(box) && require_refreshed) {
+               /* Optimization: Caller wants the list index to be up-to-date
+                  for this mailbox, but this mailbox isn't updated to the list
+                  index at all. */
                return 0;
+       }
        if (mailbox_list_index_refresh(box->list) < 0) {
                mail_storage_copy_list_error(box->storage, box->list);
                return -1;
@@ -58,7 +62,7 @@ index_list_open_view(struct mailbox *box, bool status_check,
        } else if (!mail_index_lookup_seq(view, node->uid, &seq)) {
                /* our in-memory tree is out of sync */
                ret = 1;
-       } else if (!status_check) {
+       } else if (!require_refreshed) {
                /* this operation doesn't need the index to be up-to-date */
                ret = 0;
        } else T_BEGIN {