{
enum mailbox_sync_flags sync_flags;
struct mailbox_status status;
- bool bbox_index_opened = bbox->box->opened;
int ret;
if (bbox->deleted)
if we can do that check from mailbox list index, we don't
even need to open the mailbox. */
i_assert(array_count(&bbox->sync_pending_removes) == 0);
- if (bbox_index_opened || bbox->open_failed) {
+ if (bbox->box->opened || bbox->open_failed) {
/* a) index already opened, refresh it
b) delayed error handling for mailbox_open()
that failed in virtual_notify_changes() */
- if (!bbox_index_opened) {
+ if (!bbox->box->opened) {
if (virtual_backend_box_open(ctx->mbox, bbox) < 0)
return -1;
}
virtual_sync_backend_handle_old_vmsgs(ctx, bbox, NULL);
return 0;
}
- if (!bbox_index_opened) {
+ if (!bbox->box->opened) {
/* first time we're opening the index */
- if (!bbox->box->opened) {
- if (virtual_backend_box_open(ctx->mbox, bbox) < 0)
- return -1;
- }
+ if (virtual_backend_box_open(ctx->mbox, bbox) < 0)
+ return -1;
if (mailbox_sync(bbox->box, sync_flags) < 0)
return -1;
}
i_assert(bbox->search_result != NULL || ret < 0);
} else {
/* sync using the existing search result */
- i_assert(bbox_index_opened);
+ i_assert(bbox->box->opened);
i_array_init(&ctx->sync_expunges, 32);
ret = virtual_sync_backend_box_sync(ctx, bbox, sync_flags);
if (ret == 0) T_BEGIN {