mirror of
https://github.com/M66B/FairEmail.git
synced 2026-01-01 10:35:15 +01:00
Added rule condition has attachments
This commit is contained in:
@@ -200,6 +200,13 @@ public class EntityRule {
|
||||
return false;
|
||||
}
|
||||
|
||||
// Attachments
|
||||
if (jcondition.optBoolean("attachments")) {
|
||||
DB db = DB.getInstance(context);
|
||||
if (db.attachment().getAttachments(message.id).size() == 0)
|
||||
return false;
|
||||
}
|
||||
|
||||
// Header
|
||||
JSONObject jheader = jcondition.optJSONObject("header");
|
||||
if (jheader != null && imessage != null) {
|
||||
@@ -238,7 +245,12 @@ public class EntityRule {
|
||||
}
|
||||
|
||||
// Safeguard
|
||||
if (jsender == null && jrecipient == null && jsubject == null && jheader == null && jschedule == null)
|
||||
if (jsender == null &&
|
||||
jrecipient == null &&
|
||||
jsubject == null &&
|
||||
!jcondition.optBoolean("attachments") &&
|
||||
jheader == null &&
|
||||
jschedule == null)
|
||||
return false;
|
||||
} catch (JSONException ex) {
|
||||
Log.e(ex);
|
||||
|
||||
Reference in New Issue
Block a user