[dovecot-cvs] dovecot/src/lib-storage/index index-mail.c, 1.26, 1.27 index-search.c, 1.84, 1.85 index-status.c, 1.28, 1.29 index-storage.h, 1.54, 1.55 index-sync.c, 1.29, 1.30

cras at procontrol.fi cras at procontrol.fi
Sat May 1 21:30:55 EEST 2004


Update of /home/cvs/dovecot/src/lib-storage/index
In directory talvi:/tmp/cvs-serv20974/lib-storage/index

Modified Files:
	index-mail.c index-search.c index-status.c index-storage.h 
	index-sync.c 
Log Message:
Recent-flag should work now



Index: index-mail.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-mail.c,v
retrieving revision 1.26
retrieving revision 1.27
diff -u -d -r1.26 -r1.27
--- index-mail.c	28 Apr 2004 00:18:31 -0000	1.26
+++ index-mail.c	1 May 2004 18:30:52 -0000	1.27
@@ -172,10 +172,7 @@
 	data->flags.flags = data->rec->flags;
 	/*FIXME:data->flags.custom_flags =
 		mail_custom_flags_list_get(mail->ibox->index->custom_flags);
-	data->flags.custom_flags_count = MAIL_CUSTOM_FLAGS_COUNT;
-
-	if (data->rec->uid >= mail->ibox->index->first_recent_uid)
-		data->flags.flags |= MAIL_RECENT;*/
+	data->flags.custom_flags_count = MAIL_CUSTOM_FLAGS_COUNT;*/
 
 	return &data->flags;
 }

Index: index-search.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-search.c,v
retrieving revision 1.84
retrieving revision 1.85
diff -u -d -r1.84 -r1.85
--- index-search.c	28 Apr 2004 00:21:01 -0000	1.84
+++ index-search.c	1 May 2004 18:30:52 -0000	1.85
@@ -108,10 +108,13 @@
 
 /* Returns >0 = matched, 0 = not matched, -1 = unknown */
 static int search_arg_match_index(struct index_mailbox *ibox,
-				  const struct mail_index_record *rec,
+				  struct index_mail *imail,
 				  enum mail_search_arg_type type,
 				  const char *value)
 {
+	const struct mail_index_record *rec = imail->data.rec;
+	const struct mail_full_flags *full_flags;
+
 	switch (type) {
 	case SEARCH_ALL:
 		return 1;
@@ -128,8 +131,8 @@
 	case SEARCH_SEEN:
 		return rec->flags & MAIL_SEEN;
 	case SEARCH_RECENT:
-		//FIXME:return rec->uid >= ibox->index->first_recent_uid;
-		return FALSE;
+		full_flags = imail->mail.get_flags(&imail->mail);
+		return full_flags->flags & MAIL_RECENT;
 	case SEARCH_KEYWORD:
 		return search_keyword(ibox->index, rec, value);
 
@@ -155,7 +158,7 @@
 		return;
 	}
 
-	switch (search_arg_match_index(ctx->ibox, ctx->imail.data.rec,
+	switch (search_arg_match_index(ctx->ibox, &ctx->imail,
 				       arg->type, arg->value.str)) {
 	case -1:
 		/* unknown */

Index: index-status.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-status.c,v
retrieving revision 1.28
retrieving revision 1.29
diff -u -d -r1.28 -r1.29
--- index-status.c	28 Apr 2004 00:21:01 -0000	1.28
+++ index-status.c	1 May 2004 18:30:52 -0000	1.29
@@ -55,8 +55,8 @@
 		}
 	}
 
-	/*FIXME:if (items & STATUS_RECENT)
-		status->recent = index_storage_get_recent_count(view);*/
+	if ((items & STATUS_RECENT) != 0)
+		status->recent = ibox->get_recent_count(ibox);
 
 	/*FIXME:if (items & STATUS_CUSTOM_FLAGS)
 		get_custom_flags(ibox, status);*/

Index: index-storage.h
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-storage.h,v
retrieving revision 1.54
retrieving revision 1.55
diff -u -d -r1.54 -r1.55
--- index-storage.h	27 Apr 2004 20:25:54 -0000	1.54
+++ index-storage.h	1 May 2004 18:30:52 -0000	1.55
@@ -59,6 +59,8 @@
 	struct mail_cache_view *cache_view;
 	struct mail *mail_interface;
 
+	uint32_t (*get_recent_count)(struct index_mailbox *ibox);
+
 	struct timeout *autosync_to;
 	struct index_autosync_file *autosync_files;
         struct index_autosync_io *autosync_ios;

Index: index-sync.c
===================================================================
RCS file: /home/cvs/dovecot/src/lib-storage/index/index-sync.c,v
retrieving revision 1.29
retrieving revision 1.30
diff -u -d -r1.29 -r1.30
--- index-sync.c	28 Apr 2004 21:41:24 -0000	1.29
+++ index-sync.c	1 May 2004 18:30:52 -0000	1.30
@@ -15,7 +15,7 @@
 	size_t i, expunges_count;
 	void *sc_context;
 	enum mail_index_sync_type sync_mask;
-	uint32_t seq, new_count;
+	uint32_t seq, new_count, recent_count;
 	int ret, appends;
 
 	sync_mask = MAIL_INDEX_SYNC_MASK_ALL;
@@ -81,7 +81,9 @@
 
 	if (appends) {
 		new_count = mail_index_view_get_message_count(ibox->view);
-		sc->new_messages(&ibox->box, new_count, 0, sc_context);
+		recent_count = ibox->get_recent_count(ibox);
+		sc->new_messages(&ibox->box, new_count, recent_count,
+				 sc_context);
 	}
 
 	mail_index_view_unlock(ibox->view);



More information about the dovecot-cvs mailing list