Rule refactoring

This commit is contained in:
M66B
2019-01-18 08:23:53 +00:00
parent 2709a66e34
commit 0bfc49c1e5
12 changed files with 136 additions and 245 deletions

View File

@@ -72,7 +72,6 @@ public class EntityRule {
JSONObject jcondition = new JSONObject(condition);
String sender = jcondition.optString("sender", null);
String subject = jcondition.optString("subject", null);
String text = jcondition.optString("text", null);
boolean regex = jcondition.optBoolean("regex", false);
if (sender != null && message.from != null) {
@@ -84,13 +83,6 @@ public class EntityRule {
if (matches(subject, message.subject, regex))
return true;
}
if (text != null && message.content) {
String body = message.read(context);
String santized = HtmlHelper.sanitize(body, true);
if (matches(text, santized, regex))
return true;
}
} catch (JSONException ex) {
Log.e(ex);
}