changeset 7279:ef13dd179331 HEAD

More fixes to SEARCH BEFORE/ON/SINCE timezone handling.
author Timo Sirainen <tss@iki.fi>
date Thu, 21 Feb 2008 18:18:08 +0200
parents 27b7b6c34961
children e5d3e6c598ec
files src/lib-storage/index/index-search.c
diffstat 1 files changed, 5 insertions(+), 1 deletions(-) [+]
line wrap: on
line diff
--- a/src/lib-storage/index/index-search.c	Thu Feb 21 15:57:48 2008 +0200
+++ b/src/lib-storage/index/index-search.c	Thu Feb 21 18:18:08 2008 +0200
@@ -4,6 +4,7 @@
 #include "ioloop.h"
 #include "array.h"
 #include "istream.h"
+#include "utc-offset.h"
 #include "str.h"
 #include "message-address.h"
 #include "message-date.h"
@@ -183,6 +184,7 @@
 static int search_arg_match_cached(struct index_search_context *ctx,
 				   struct mail_search_arg *arg)
 {
+	struct tm *tm;
 	uoff_t virtual_size;
 	time_t date;
 	int timezone_offset;
@@ -194,7 +196,9 @@
 	case SEARCH_SINCE:
 		if (mail_get_received_date(ctx->mail, &date) < 0)
 			return -1;
-		date -= ioloop_timezone.tz_minuteswest*60;
+
+		tm = localtime(&date);
+		date += utc_offset(tm, date)*60;
 
 		switch (arg->type) {
 		case SEARCH_BEFORE: