Lines Matching refs:box

11 get_last_cached_seq(struct mailbox *box, uint32_t *last_cached_seq_r)
18 if (!mail_cache_exists(box->cache))
21 cache_view = mail_cache_view_open(box->cache, box->view);
22 hdr = mail_index_get_header(box->view);
32 int index_storage_get_status(struct mailbox *box,
42 if (!box->opened) {
43 if (mailbox_open(box) < 0)
45 if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0)
48 index_storage_get_open_status(box, items, status_r);
52 static unsigned int index_storage_count_pvt_unseen(struct mailbox *box)
63 shared_count = mail_index_view_get_messages_count(box->view);
64 pvt_count = mail_index_view_get_messages_count(box->view_pvt);
67 mail_index_lookup_uid(box->view, shared_seq, &shared_uid);
68 pvt_rec = mail_index_lookup(box->view_pvt, pvt_seq);
84 static uint32_t index_storage_find_first_pvt_unseen_seq(struct mailbox *box)
90 pvt_count = mail_index_view_get_messages_count(box->view_pvt);
91 mail_index_lookup_first(box->view_pvt, 0, MAIL_SEEN, &pvt_seq);
95 pvt_rec = mail_index_lookup(box->view_pvt, pvt_seq);
97 mail_index_lookup_seq(box->view, pvt_rec->uid, &shared_seq))
102 pvt_hdr = mail_index_get_header(box->view_pvt);
103 if (mail_index_lookup_seq_range(box->view,
110 void index_storage_get_open_status(struct mailbox *box,
117 hdr = mail_index_get_header(box->view);
120 if ((box->flags & MAILBOX_FLAG_DROP_RECENT) != 0) {
124 i_assert(box->synced);
128 index_sync_update_recent_count(box);
130 status_r->recent = mailbox_recent_flags_count(box);
134 if (box->view_pvt == NULL ||
135 (mailbox_get_private_flags_mask(box) & MAIL_SEEN) == 0) {
139 status_r->unseen = index_storage_count_pvt_unseen(box);
147 mail_index_is_in_memory(box->index);
149 !mail_index_have_modseq_tracking(box->index);
151 mail_index_modseq_get_highest(box->view);
157 if ((items & STATUS_HIGHESTPVTMODSEQ) != 0 && box->view_pvt != NULL) {
159 mail_index_modseq_get_highest(box->view_pvt);
167 if (box->view_pvt == NULL ||
168 (mailbox_get_private_flags_mask(box) & MAIL_SEEN) == 0) {
169 mail_index_lookup_first(box->view, 0, MAIL_SEEN,
173 index_storage_find_first_pvt_unseen_seq(box);
177 get_last_cached_seq(box, &status_r->last_cached_seq);
180 status_r->keywords = mail_index_get_keywords(box->index);
182 if (!mailbox_is_readonly(box)) {
186 !box->disallow_new_keywords;
193 get_metadata_cache_fields(struct mailbox *box,
202 if (box->metadata_pool == NULL) {
203 box->metadata_pool =
207 fields = mail_cache_register_get_list(box->cache,
208 box->metadata_pool, &count);
210 cache_fields = p_new(box->metadata_pool,
212 p_array_init(cache_fields, box->metadata_pool, count);
225 static void get_metadata_precache_fields(struct mailbox *box,
232 fields = mail_cache_register_get_list(box->cache,
263 } else if (box->storage->set->mail_debug)
270 index_mailbox_get_first_save_date(struct mailbox *box,
279 hdr = mail_index_get_header(box->view);
285 t = mailbox_transaction_begin(box, 0, __func__);
293 if (mailbox_get_last_mail_error(box) != MAIL_ERROR_EXPUNGED) {
308 int index_mailbox_get_metadata(struct mailbox *box,
316 mailbox_list_get_namespace(box->list)->type;
323 if (!box->opened) {
324 if (mailbox_open(box) < 0)
327 if (!box->synced && (items & MAILBOX_METADATA_SYNC_ITEMS) != 0) {
328 if (mailbox_sync(box, MAILBOX_SYNC_FLAG_FAST) < 0)
333 if (index_mailbox_get_virtual_size(box, metadata_r) < 0)
337 if (index_mailbox_get_physical_size(box, metadata_r) < 0)
341 if (index_mailbox_get_first_save_date(box, metadata_r) < 0)
345 get_metadata_cache_fields(box, metadata_r);
347 get_metadata_precache_fields(box, metadata_r);