src/strip.vala
authorAlan Knowles <alan@roojs.com>
Wed, 9 May 2018 09:59:31 +0000 (17:59 +0800)
committerAlan Knowles <alan@roojs.com>
Wed, 9 May 2018 09:59:31 +0000 (17:59 +0800)
src/strip.vala

index 5e8825e..5befbe2 100644 (file)
@@ -755,7 +755,13 @@ public class Strip : GLib.Object {
                        GLib.debug("skip(2) file is %d days older than %d months", (int)rtspan, StripApplication.opt_age_oldest);
                        return;
                }
-
+               var newest = new  DateTime.now_local();
+               newest = oldest.add_months(-1 * StripApplication.opt_age_newest);
+               rtspan = mailtime.difference(newest) / GLib.TimeSpan.DAY;
+               if (rtspan > 0) {
+                       GLib.debug("skip file is %d days newer than %d months", (int)rtspan, StripApplication.opt_age_oldest);
+                       return;
+               }