mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-23 10:15:58 +01:00
Fixed automation action preview
This commit is contained in:
@@ -680,7 +680,7 @@ public class EntityRule {
|
||||
case TYPE_TTS:
|
||||
return onActionTts(context, message, browsed, jaction);
|
||||
case TYPE_AUTOMATION:
|
||||
return onActionAutomation(context, message, jaction);
|
||||
return onActionAutomation(context, message, jaction, html);
|
||||
case TYPE_DELETE:
|
||||
return onActionDelete(context, message, jaction);
|
||||
case TYPE_SOUND:
|
||||
@@ -1285,7 +1285,7 @@ public class EntityRule {
|
||||
ServiceSend.schedule(context, SEND_DELAY);
|
||||
}
|
||||
|
||||
private boolean onActionAutomation(Context context, EntityMessage message, JSONObject jargs) {
|
||||
private boolean onActionAutomation(Context context, EntityMessage message, JSONObject jargs, String html) {
|
||||
InternetAddress iaddr =
|
||||
(message.from == null || message.from.length == 0
|
||||
? null : ((InternetAddress) message.from[0]));
|
||||
@@ -1294,13 +1294,16 @@ public class EntityRule {
|
||||
DateFormat DTF = new SimpleDateFormat("yyyy-MM-dd'T'HH:mm:ss'Z'");
|
||||
DTF.setTimeZone(java.util.TimeZone.getTimeZone("Zulu"));
|
||||
|
||||
String text = HtmlHelper.getFullText(context, html);
|
||||
String preview = HtmlHelper.getPreview(text);
|
||||
|
||||
Intent automation = new Intent(ACTION_AUTOMATION);
|
||||
automation.putExtra(EXTRA_RULE, name);
|
||||
automation.putExtra(EXTRA_RECEIVED, DTF.format(message.received));
|
||||
automation.putExtra(EXTRA_SENDER, iaddr == null ? null : iaddr.getAddress());
|
||||
automation.putExtra(EXTRA_NAME, iaddr == null ? null : iaddr.getPersonal());
|
||||
automation.putExtra(EXTRA_SUBJECT, message.subject);
|
||||
automation.putExtra(EXTRA_PREVIEW, message.preview);
|
||||
automation.putExtra(EXTRA_PREVIEW, preview);
|
||||
|
||||
List<String> extras = Log.getExtras(automation.getExtras());
|
||||
EntityLog.log(context, EntityLog.Type.Rules, message,
|
||||
|
||||
Reference in New Issue
Block a user