changeset 5966:731be87a2128 HEAD

Make sure cache is opened when mail_cache_field_can_add() or mail_cache_field_want_add() is called.
author Timo Sirainen <tss@iki.fi>
date Thu, 12 Jul 2007 06:40:51 +0300
parents 921bc18b164a
children 0a6dd369afff
files src/lib-index/mail-cache-transaction.c
diffstat 1 files changed, 6 insertions(+), 0 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-index/mail-cache-transaction.c	Thu Jul 12 06:15:49 2007 +0300
+++ b/src/lib-index/mail-cache-transaction.c	Thu Jul 12 06:40:51 2007 +0300
@@ -815,6 +815,9 @@
 {
 	enum mail_cache_decision_type decision;
 
+	if (!ctx->cache->opened)
+		(void)mail_cache_open_and_verify(ctx->cache);
+
 	decision = mail_cache_field_get_decision(ctx->view->cache, field_idx);
 	if ((decision & ~MAIL_CACHE_DECISION_FORCED) == MAIL_CACHE_DECISION_NO)
 		return FALSE;
@@ -827,6 +830,9 @@
 {
 	enum mail_cache_decision_type decision;
 
+	if (!ctx->cache->opened)
+		(void)mail_cache_open_and_verify(ctx->cache);
+
 	decision = mail_cache_field_get_decision(ctx->view->cache, field_idx);
 	if (decision == (MAIL_CACHE_DECISION_FORCED | MAIL_CACHE_DECISION_NO))
 		return FALSE;