mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 01:36:55 +00:00
Refactoring
This commit is contained in:
parent
9150746f75
commit
726ea077ff
1 changed files with 13 additions and 4 deletions
|
@ -208,10 +208,8 @@ public class EntityRule {
|
|||
if (expression != null) {
|
||||
if ("header".equals(what) && needsHeaders(expression))
|
||||
return true;
|
||||
if ("body".equals(what))
|
||||
for (String variable : expression.getUsedVariables())
|
||||
if ("text".equalsIgnoreCase(variable))
|
||||
return true;
|
||||
if ("body".equals(what) && needsBody(expression))
|
||||
return true;
|
||||
}
|
||||
}
|
||||
} catch (Throwable ex) {
|
||||
|
@ -759,6 +757,17 @@ public class EntityRule {
|
|||
return false;
|
||||
}
|
||||
|
||||
static boolean needsBody(Expression expression) {
|
||||
try {
|
||||
for (String variable : expression.getUsedVariables())
|
||||
if ("text".equalsIgnoreCase(variable))
|
||||
return true;
|
||||
} catch (Throwable ex) {
|
||||
Log.e(ex);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
boolean execute(Context context, EntityMessage message, String html) throws JSONException, IOException {
|
||||
boolean executed = _execute(context, message, html);
|
||||
if (this.id != null && executed) {
|
||||
|
|
Loading…
Reference in a new issue