changeset 1070:5c34c363a062 HEAD

Fixes to SEARCH SENT*
author Timo Sirainen <tss@iki.fi>
date Sat, 01 Feb 2003 13:37:22 +0200
parents 8024a2cdc406
children d71e0aa00d75
files src/lib-storage/index/index-search.c
diffstat 1 files changed, 13 insertions(+), 2 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c	Sat Feb 01 13:24:17 2003 +0200
+++ b/src/lib-storage/index/index-search.c	Sat Feb 01 13:37:22 2003 +0200
@@ -405,6 +405,7 @@
 		case SEARCH_SENTON:
 		case SEARCH_SENTSINCE:
 			ret = search_sent(arg->type, arg->value.str, field);
+			break;
 		default:
 			if (arg->value.str[0] == '\0') {
 				/* we're just testing existence of the field.
@@ -467,8 +468,9 @@
 		/* date is handled differently than others */
 		if (ctx->name_len == 4 &&
 		    memcasecmp(ctx->name, "Date", 4) == 0) {
-			search_sent(arg->type, arg->value.str,
-				    t_strndup(ctx->value, ctx->value_len));
+			ret = search_sent(arg->type, arg->value.str,
+				t_strndup(ctx->value, ctx->value_len));
+			ARG_SET_RESULT(arg, ret);
 		}
 		return;
 
@@ -548,6 +550,15 @@
 				  void *context __attr_unused__)
 {
 	switch (arg->type) {
+	case SEARCH_SENTBEFORE:
+	case SEARCH_SENTON:
+	case SEARCH_SENTSINCE:
+		if (arg->not) {
+			/* date header not found, so we match only for
+			   NOT searches */
+			ARG_SET_RESULT(arg, 0);
+		}
+		break;
 	case SEARCH_FROM:
 	case SEARCH_TO:
 	case SEARCH_CC: