mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 21:58:52 +02:00
Added rule action permanent delete
This commit is contained in:
@@ -113,6 +113,7 @@ public class EntityRule {
|
||||
static final int TYPE_HIDE = 12;
|
||||
static final int TYPE_IMPORTANCE = 13;
|
||||
static final int TYPE_TTS = 14;
|
||||
static final int TYPE_DELETE = 15;
|
||||
|
||||
static final String ACTION_AUTOMATION = BuildConfig.APPLICATION_ID + ".AUTOMATION";
|
||||
static final String EXTRA_RULE = "rule";
|
||||
@@ -464,6 +465,8 @@ public class EntityRule {
|
||||
return onActionTts(context, message, jaction);
|
||||
case TYPE_AUTOMATION:
|
||||
return onActionAutomation(context, message, jaction);
|
||||
case TYPE_DELETE:
|
||||
return onActionDelete(context, message, jaction);
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown rule type=" + type + " name=" + name);
|
||||
}
|
||||
@@ -528,6 +531,8 @@ public class EntityRule {
|
||||
return;
|
||||
case TYPE_AUTOMATION:
|
||||
return;
|
||||
case TYPE_DELETE:
|
||||
return;
|
||||
default:
|
||||
throw new IllegalArgumentException("Unknown rule type=" + type);
|
||||
}
|
||||
@@ -928,6 +933,14 @@ public class EntityRule {
|
||||
return true;
|
||||
}
|
||||
|
||||
private boolean onActionDelete(Context context, EntityMessage message, JSONObject jargs) {
|
||||
EntityOperation.queue(context, message, EntityOperation.DELETE);
|
||||
|
||||
message.ui_hide = true;
|
||||
|
||||
return true;
|
||||
}
|
||||
|
||||
private static Calendar getRelativeCalendar(int minutes, long reference) {
|
||||
int d = minutes / (24 * 60);
|
||||
int h = minutes / 60 % 24;
|
||||
|
||||
Reference in New Issue
Block a user