Cosmetics.
authorFrancois Fleuret <francois@fleuret.org>
Tue, 5 Feb 2013 13:44:42 +0000 (14:44 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Tue, 5 Feb 2013 13:44:42 +0000 (14:44 +0100)
mymail.c

index 2519a7a..20d0419 100644 (file)
--- a/mymail.c
+++ b/mymail.c
@@ -709,12 +709,16 @@ void init_condition(struct search_condition *condition, char *string) {
     condition->negation = 0;
   }
 
-  if(strcmp(search_field, "6h") == 0) {
+  /* Last 8 hours */
+
+  if(strcmp(search_field, "8h") == 0) {
     condition->field_id = ID_INTERVAL;
-    condition->interval_start = time(0) - 3600 * 6;
+    condition->interval_start = time(0) - 3600 * 8;
     condition->interval_stop = 0;
   }
 
+  /* Today and yesterday */
+
   else if(strcmp(search_field, "24h") == 0 ||
           strcmp(search_field, "today") == 0) {
     condition->field_id = ID_INTERVAL;
@@ -722,6 +726,14 @@ void init_condition(struct search_condition *condition, char *string) {
     condition->interval_stop = 0;
   }
 
+  else if(strcmp(search_field, "yesterday") == 0) {
+    condition->field_id = ID_INTERVAL;
+    condition->interval_start = time(0) - 2 * 3600 * 24;
+    condition->interval_stop = condition->interval_start + 3600 * 24;
+  }
+
+  /* Week days */
+
   else if(strcmp(search_field, "monday") == 0) {
     condition->field_id = ID_INTERVAL;
     condition->interval_start = time_for_past_day(1);
@@ -764,12 +776,6 @@ void init_condition(struct search_condition *condition, char *string) {
     condition->interval_stop = condition->interval_start + 3600 * 24;
   }
 
-  else if(strcmp(search_field, "yesterday") == 0) {
-    condition->field_id = ID_INTERVAL;
-    condition->interval_start = time(0) - 2 * 3600 * 24;
-    condition->interval_stop = condition->interval_start + 3600 * 24;
-  }
-
   else {
     condition->field_id = -1;