projects
/
app.mailtrimmer
/ commitdiff
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
| commitdiff |
tree
raw
|
patch
|
inline
| side by side (parent:
179833e
)
src/strip.vala
author
Alan Knowles
<alan@roojs.com>
Wed, 9 May 2018 09:06:06 +0000
(17:06 +0800)
committer
Alan Knowles
<alan@roojs.com>
Wed, 9 May 2018 09:06:06 +0000
(17:06 +0800)
src/strip.vala
patch
|
blob
|
history
diff --git
a/src/strip.vala
b/src/strip.vala
index
1b43755
..
71351d6
100644
(file)
--- a/
src/strip.vala
+++ b/
src/strip.vala
@@
-654,6
+654,16
@@
public class Strip : GLib.Object {
this.created_date = this.created_dir.replace("/", "-");
var bits = this.created_date.split("-");
mailtime = new DateTime.local(int.parse(bits[0]),int.parse(bits[1]),int.parse(bits[2]),0,0,0);
this.created_date = this.created_dir.replace("/", "-");
var bits = this.created_date.split("-");
mailtime = new DateTime.local(int.parse(bits[0]),int.parse(bits[1]),int.parse(bits[2]),0,0,0);
+
+ var oldest = new DateTime.now_local();
+ oldest.add_months(-1 * StripApplication.opt_min_age);
+ var tspan = mailtime.difference(oldest) / GLib.TimeSpan.DAY;
+
+ if (tspan < 0) {
+ GLib.debug("skip file is %d days older than %d months", (int)tspan, StripApplication.opt_min_age);
+ return;
+ }
+
}
}