[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.101, 1.102 index-mail.h, 1.41, 1.42

tss-movial at dovecot.org tss-movial at dovecot.org
Thu Jun 29 14:09:00 EEST 2006


Update of /var/lib/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv13610/index

Modified Files:
	index-mail.c index-mail.h 
Log Message:
Added mail_get_save_date() and some cleanups.



Index: index-mail.c
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.101
retrieving revision 1.102
diff -u -d -r1.101 -r1.102
--- index-mail.c	28 Jun 2006 13:10:49 -0000	1.101
+++ index-mail.c	29 Jun 2006 11:08:55 -0000	1.102
@@ -119,16 +119,6 @@
 					    MAIL_CACHE_PHYSICAL_FULL_SIZE);
 }
 
-time_t index_mail_get_cached_received_date(struct index_mail *mail)
-{
-	time_t t;
-
-	if (!index_mail_get_fixed_field(mail, MAIL_CACHE_RECEIVED_DATE,
-					&t, sizeof(t)))
-		t = (time_t)-1;
-	return t;
-}
-
 enum mail_flags index_mail_get_flags(struct mail *_mail)
 {
 	struct index_mail *mail = (struct index_mail *) _mail;
@@ -215,14 +205,30 @@
 	struct index_mail_data *data = &mail->data;
 
 	if (data->received_date == (time_t)-1) {
-		data->received_date = index_mail_get_cached_received_date(mail);
-		if (data->received_date != (time_t)-1)
-			return data->received_date;
+		if (!index_mail_get_fixed_field(mail, MAIL_CACHE_RECEIVED_DATE,
+						&data->received_date,
+						sizeof(data->received_date)))
+			return (time_t)-1;
 	}
 
 	return data->received_date;
 }
 
+time_t index_mail_get_save_date(struct mail *_mail)
+{
+	struct index_mail *mail = (struct index_mail *) _mail;
+	struct index_mail_data *data = &mail->data;
+
+	if (data->save_date == (time_t)-1) {
+		if (!index_mail_get_fixed_field(mail, MAIL_CACHE_SAVE_DATE,
+						&data->save_date,
+						sizeof(data->save_date)))
+			return (time_t)-1;
+	}
+
+	return data->save_date;
+}
+
 time_t index_mail_get_date(struct mail *_mail, int *timezone)
 {
 	struct index_mail *mail = (struct index_mail *) _mail;

Index: index-mail.h
===================================================================
RCS file: /var/lib/cvs/dovecot/src/lib-storage/index/index-mail.h,v
retrieving revision 1.41
retrieving revision 1.42
diff -u -d -r1.41 -r1.42
--- index-mail.h	28 Jun 2006 13:10:49 -0000	1.41
+++ index-mail.h	29 Jun 2006 11:08:55 -0000	1.42
@@ -10,6 +10,7 @@
 	MAIL_CACHE_FLAGS = 0,
 	MAIL_CACHE_SENT_DATE,
 	MAIL_CACHE_RECEIVED_DATE,
+	MAIL_CACHE_SAVE_DATE,
 	MAIL_CACHE_VIRTUAL_FULL_SIZE,
 	MAIL_CACHE_PHYSICAL_FULL_SIZE,
 
@@ -67,7 +68,7 @@
 
 struct index_mail_data {
 	enum mail_flags flags;
-	time_t date, received_date;
+	time_t date, received_date, save_date;
 	uoff_t virtual_size, physical_size;
 
 	struct mail_sent_date sent_date;
@@ -153,6 +154,7 @@
 const char *const *index_mail_get_keywords(struct mail *_mail);
 const struct message_part *index_mail_get_parts(struct mail *_mail);
 time_t index_mail_get_received_date(struct mail *_mail);
+time_t index_mail_get_save_date(struct mail *_mail);
 time_t index_mail_get_date(struct mail *_mail, int *timezone);
 uoff_t index_mail_get_virtual_size(struct mail *mail);
 uoff_t index_mail_get_physical_size(struct mail *mail);
@@ -171,7 +173,6 @@
 uoff_t index_mail_get_cached_uoff_t(struct index_mail *mail,
 				    enum index_cache_field field);
 uoff_t index_mail_get_cached_virtual_size(struct index_mail *mail);
-time_t index_mail_get_cached_received_date(struct index_mail *mail);
 
 void index_mail_cache_add(struct index_mail *mail, unsigned int field,
 			  const void *data, size_t data_size);



More information about the dovecot-cvs mailing list