Skip to content

Commit

Permalink
fix deprecated legacy flag expiration/is_expired tags
Browse files Browse the repository at this point in the history
  • Loading branch information
mcmonkey4eva committed Jan 13, 2021
1 parent ef5351d commit 846bf14
Showing 1 changed file with 5 additions and 2 deletions.
Expand Up @@ -126,15 +126,18 @@ public ObjectTag doFlagTag(Attribute attribute) {
}
if (attribute.getAttributeWithoutContext(2).equals("is_expired")) {
Deprecations.flagIsExpiredTag.warn(attribute.context);
return new ElementTag(!hasFlag(attribute.getContext(1)));
boolean result = !hasFlag(attribute.getContext(1));
attribute.fulfill(1);
return new ElementTag(result);
}
else if (attribute.getAttributeWithoutContext(2).equals("expiration")) {
Deprecations.flagExpirationTag.warn(attribute.context);
TimeTag time = getFlagExpirationTime(attribute.getContext(1));
if (time == null) {
return null;
}
return new DurationTag((TimeTag.now().millis() - time.millis()) / 1000.0);
attribute.fulfill(1);
return new DurationTag((time.millis() - TimeTag.now().millis()) / 1000.0);
}
return getFlagValue(attribute.getContext(1));
}
Expand Down

0 comments on commit 846bf14

Please sign in to comment.