Refactoring

This commit is contained in:
M66B 2024-04-17 19:31:50 +02:00
parent 613f72e769
commit ac55dcc31b
1 changed files with 3 additions and 4 deletions

View File

@ -713,11 +713,10 @@ public class EntityRule {
for (Address a : message.from) for (Address a : message.from)
from.add(MessageHelper.formatAddresses(new Address[]{a})); from.add(MessageHelper.formatAddresses(new Address[]{a}));
String text = null; Document doc = null;
if (message != null && message.content) if (message != null && message.content)
try { try {
Document d = JsoupEx.parse(message.getFile(context)); doc = JsoupEx.parse(message.getFile(context));
text = d.text();
} catch (IOException ex) { } catch (IOException ex) {
Log.e(ex); Log.e(ex);
} }
@ -739,7 +738,7 @@ public class EntityRule {
.with("to", to) .with("to", to)
.with("from", from) .with("from", from)
.with("subject", message == null ? null : Arrays.asList(message.subject)) .with("subject", message == null ? null : Arrays.asList(message.subject))
.with("text", Arrays.asList(text)); .with("text", doc == null ? null : Arrays.asList(doc.text()));
} }
static boolean needsHeaders(Expression expression) { static boolean needsHeaders(Expression expression) {