From: Francois Fleuret Date: Tue, 5 Feb 2013 13:44:42 +0000 (+0100) Subject: Cosmetics. X-Git-Url: https://fleuret.org/cgi-bin/gitweb/gitweb.cgi?a=commitdiff_plain;h=1d852dd39736a83b168bbd1f4b0070f40b34be49;p=mymail.git Cosmetics. --- diff --git a/mymail.c b/mymail.c index 2519a7a..20d0419 100644 --- 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;