Properly handle purging of SCANFROM reminders.

This commit is contained in:
Dianne Skoll
2024-06-02 12:07:12 -04:00
parent 73917ee537
commit 07fca94a7f
+6 -6
View File
@@ -162,7 +162,7 @@ int DoRem(ParsePtr p)
if (p->expr_happened) {
if (p->nonconst_expr) {
PurgeEchoLine("%s\n", "#!P: Next line may have expired, but contains non-constant expression");
PurgeEchoLine("%s\n", "#!P: or a SCANFROM clause");
PurgeEchoLine("%s\n", "#!P: or a relative SCANFROM clause");
PurgeEchoLine("%s\n", CurLine);
} else {
PurgeEchoLine("%s\n", "#!P: Next line has expired, but contains expression... please verify");
@@ -363,11 +363,6 @@ int ParseRem(ParsePtr s, Trigger *trig, TimeTrig *tim)
DBufFree(&buf);
r=ParseScanFrom(s, trig, tok.val);
if (r) return r;
/* Don't expire reminders with a scanfrom */
if (PurgeMode) {
s->expr_happened = 1;
s->nonconst_expr = 1;
}
break;
case T_RemType:
@@ -869,6 +864,11 @@ static int ParseScanFrom(ParsePtr s, Trigger *t, int type)
tok.val = -tok.val;
}
FromDSE(DSEToday - tok.val, &y, &m, &d);
if (PurgeMode) {
/* Don't purge reminders with a relative scanfrom */
s->expr_happened = 1;
s->nonconst_expr = 1;
}
break;
default: