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

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