|
|
@ -239,6 +239,26 @@ public class EntityRule {
|
|
|
|
String value = jheader.getString("value");
|
|
|
|
String value = jheader.getString("value");
|
|
|
|
boolean regex = jheader.getBoolean("regex");
|
|
|
|
boolean regex = jheader.getBoolean("regex");
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!regex &&
|
|
|
|
|
|
|
|
value != null &&
|
|
|
|
|
|
|
|
value.startsWith("$") &&
|
|
|
|
|
|
|
|
value.endsWith("$")) {
|
|
|
|
|
|
|
|
String keyword = value.substring(1, value.length() - 1);
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
List<String> keywords = new ArrayList<>();
|
|
|
|
|
|
|
|
if (message.ui_seen)
|
|
|
|
|
|
|
|
keywords.add("$seen");
|
|
|
|
|
|
|
|
if (message.ui_answered)
|
|
|
|
|
|
|
|
keywords.add("$answered");
|
|
|
|
|
|
|
|
if (message.ui_flagged)
|
|
|
|
|
|
|
|
keywords.add("$flagged");
|
|
|
|
|
|
|
|
if (message.ui_deleted)
|
|
|
|
|
|
|
|
keywords.add("$deleted");
|
|
|
|
|
|
|
|
keywords.addAll(Arrays.asList(message.keywords));
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
if (!keywords.contains(keyword))
|
|
|
|
|
|
|
|
return false;
|
|
|
|
|
|
|
|
} else {
|
|
|
|
boolean matches = false;
|
|
|
|
boolean matches = false;
|
|
|
|
Enumeration<Header> headers;
|
|
|
|
Enumeration<Header> headers;
|
|
|
|
if (imessage != null)
|
|
|
|
if (imessage != null)
|
|
|
@ -259,6 +279,7 @@ public class EntityRule {
|
|
|
|
if (!matches)
|
|
|
|
if (!matches)
|
|
|
|
return false;
|
|
|
|
return false;
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
|
|
// Date
|
|
|
|
// Date
|
|
|
|
JSONObject jdate = jcondition.optJSONObject("date");
|
|
|
|
JSONObject jdate = jcondition.optJSONObject("date");
|
|
|
|