Lines Matching defs:tbox
119 struct mail_thread_mailbox *tbox = context;
120 struct mail_thread_context *ctx = tbox->ctx;
144 struct mail_thread_mailbox *tbox = context;
145 struct mail_thread_context *ctx = tbox->ctx;
165 struct mail_thread_mailbox *tbox = context;
166 struct mail_thread_cache *cache = tbox->cache;
302 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(ctx->box);
310 if (tbox->strmap_view == NULL) {
312 tbox->strmap_view =
313 mail_index_strmap_view_open(tbox->strmap,
318 tbox, &tbox->msgid_map,
319 &tbox->msgid_hash);
326 ctx->strmap_sync = mail_index_strmap_view_sync_init(tbox->strmap_view,
367 static bool mail_thread_cache_update_removes(struct mail_thread_mailbox *tbox,
370 struct mail_thread_cache *cache = tbox->cache;
389 msgid_map = array_get(tbox->msgid_map, &map_count);
420 static void mail_thread_cache_update_adds(struct mail_thread_mailbox *tbox,
423 struct mail_thread_cache *cache = tbox->cache;
435 (void)array_bsearch_insert_pos(tbox->msgid_map, &uids[0].seq1,
437 msgid_map = array_get(tbox->msgid_map, &map_count);
453 mail_thread_cache_fix_invalid_indexes(struct mail_thread_mailbox *tbox)
455 struct mail_thread_cache *cache = tbox->cache;
458 highest_idx = mail_index_strmap_view_get_highest_idx(tbox->strmap_view);
479 static void mail_thread_cache_sync_remove(struct mail_thread_mailbox *tbox,
482 struct mail_thread_cache *cache = tbox->cache;
490 if (mail_thread_cache_update_removes(tbox, &ctx->added_uids)) {
499 static void mail_thread_cache_sync_add(struct mail_thread_mailbox *tbox,
503 struct mail_thread_cache *cache = tbox->cache;
508 mail_thread_cache_fix_invalid_indexes(tbox);
513 mail_thread_cache_update_adds(tbox, &ctx->added_uids);
519 mail_index_strmap_view_get_highest_idx(tbox->strmap_view) + 1 +
528 msgid_map = array_get(tbox->msgid_map, &count);
544 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(box);
549 i_assert(tbox->ctx == NULL);
566 tbox->ctx = ctx;
568 mail_thread_cache_sync_remove(tbox, ctx);
571 mail_thread_cache_sync_add(tbox, ctx, search_ctx);
577 mail_index_strmap_view_set_corrupted(tbox->strmap_view);
598 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(ctx->box);
604 tbox->ctx = NULL;
612 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(ctx->box);
614 return mail_thread_iterate_init_full(tbox->cache, ctx->tmp_mail,
620 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(box);
622 i_assert(tbox->ctx == NULL);
624 if (tbox->strmap_view != NULL)
625 mail_index_strmap_view_close(&tbox->strmap_view);
626 if (tbox->cache->search_result != NULL)
627 mailbox_search_result_free(&tbox->cache->search_result);
628 tbox->module_ctx.super.close(box);
633 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT_REQUIRE(box);
635 mail_index_strmap_deinit(&tbox->strmap);
636 tbox->module_ctx.super.free(box);
638 array_free(&tbox->cache->thread_nodes);
639 i_free(tbox->cache);
640 i_free(tbox);
645 struct mail_thread_mailbox *tbox = MAIL_THREAD_CONTEXT(box);
647 if (tbox != NULL) {
652 tbox = i_new(struct mail_thread_mailbox, 1);
653 tbox->module_ctx.super = box->v;
657 tbox->strmap = mail_index_strmap_init(box->index,
659 tbox->next_msgid_idx = 1;
661 tbox->cache = i_new(struct mail_thread_cache, 1);
662 i_array_init(&tbox->cache->thread_nodes, 128);
664 MODULE_CONTEXT_SET(box, mail_thread_storage_module, tbox);