Added the "week" search criterion.
authorFrancois Fleuret <francois@fleuret.org>
Wed, 6 Feb 2013 08:02:51 +0000 (09:02 +0100)
committerFrancois Fleuret <francois@fleuret.org>
Wed, 6 Feb 2013 08:02:51 +0000 (09:02 +0100)
mymail.1
mymail.c

index 2ba2122..62d6def 100644 (file)
--- a/mymail.1
+++ b/mymail.1
@@ -99,6 +99,8 @@ entirely.
 .TP
 \fBtoday\fR, \fB24h\fR selects mails received during the last 24 hours.
 .TP
+\fBweek\fR selects mails received during the last 7*24 hours.
+.TP
 \fByesterday\fR selects mails received between 48h and 24h ago.
 .TP
 \fBmonday\fR, \fBtuesday\fR, ..., \fBsunday\fR selects mails received
index bac2f45..0e9009a 100644 (file)
--- a/mymail.c
+++ b/mymail.c
@@ -710,6 +710,12 @@ void init_condition(struct search_condition *condition, char *string) {
     condition->interval_stop = 0;
   }
 
+  else if(strcmp(search_field, "week") == 0) {
+    condition->field_id = ID_INTERVAL;
+    condition->interval_start = time(0) - 3600 * 24 * 7;
+    condition->interval_stop = 0;
+  }
+
   /* Today and yesterday */
 
   else if(strcmp(search_field, "24h") == 0 ||
@@ -834,6 +840,7 @@ int main(int argc, char **argv) {
   paranoid = 0;
   action_index = 0;
   db_filename = 0;
+  db_filename_regexp_string = 0;
   db_root_path = 0;
   db_filename_list = 0;
   quiet = 0;