Allow standalone older than condition

pull/217/head
M66B 5 months ago
parent b982a27679
commit 0ffe5bf9e5

@ -246,10 +246,11 @@ public class EntityRule {
JSONObject jcondition = new JSONObject(condition); JSONObject jcondition = new JSONObject(condition);
// general // general
int age = 0;
if (this.daily) { if (this.daily) {
JSONObject jgeneral = jcondition.optJSONObject("general"); JSONObject jgeneral = jcondition.optJSONObject("general");
if (jgeneral != null) { if (jgeneral != null) {
int age = jgeneral.optInt("age"); age = jgeneral.optInt("age");
if (age > 0) { if (age > 0) {
Calendar cal = Calendar.getInstance(); Calendar cal = Calendar.getInstance();
cal.setTimeInMillis(message.received); cal.setTimeInMillis(message.received);
@ -505,7 +506,8 @@ public class EntityRule {
} }
// Safeguard // Safeguard
if (jsender == null && if (age == 0 &&
jsender == null &&
jrecipient == null && jrecipient == null &&
jsubject == null && jsubject == null &&
!jcondition.optBoolean("attachments") && !jcondition.optBoolean("attachments") &&

@ -1686,7 +1686,15 @@ public class FragmentRule extends FragmentBase {
} }
} }
if (jsender == null && int age = 0;
if (daily) {
JSONObject jgeneral = jcondition.optJSONObject("general");
if (jgeneral != null)
age = jgeneral.optInt("age");
}
if (age == 0 &&
jsender == null &&
jrecipient == null && jrecipient == null &&
jsubject == null && jsubject == null &&
!jcondition.optBoolean("attachments") && !jcondition.optBoolean("attachments") &&

Loading…
Cancel
Save