it->cache_view = mail_cache_view_open(box->cache, t->view);
it->cache_trans = mail_cache_get_transaction(it->cache_view, t->itrans);
+ t->cache_view = it->cache_view;
+ t->cache_trans = it->cache_trans;
+
/* set up after mail_cache_get_transaction(), so that we'll still
have the cache_trans available in _index_commit() */
it->super = t->itrans->v;
/* view contains all changes done within this transaction */
struct mail_index_view *view;
+ struct mail_cache_view *cache_view;
+ struct mail_cache_transaction_ctx *cache_trans;
+
struct mail_transaction_commit_changes *changes;
ARRAY_DEFINE(module_contexts,
union mailbox_transaction_module_context *);
void mail_update_pop3_uidl(struct mail *mail, const char *uidl);
/* Expunge this message. Sequence numbers don't change until commit. */
void mail_expunge(struct mail *mail);
+
+/* Returns TRUE if anything is cached for the mail, FALSE if not. */
+bool mail_is_cached(struct mail *mail);
/* Mark a cached field corrupted and have it recalculated. */
void mail_set_cache_corrupted(struct mail *mail, enum mail_fetch_field field);
#include "crc32.h"
#include "sha1.h"
#include "hostpid.h"
+#include "mail-cache.h"
#include "mail-storage-private.h"
#include <time.h>
mail->expunged = TRUE;
}
+bool mail_is_cached(struct mail *mail)
+{
+ return mail_cache_field_exists_any(mail->transaction->cache_view,
+ mail->seq);
+}
+
void mail_set_cache_corrupted(struct mail *mail, enum mail_fetch_field field)
{
struct mail_private *p = (struct mail_private *)mail;