diff --git a/app/src/main/java/eu/faircode/email/AdapterRule.java b/app/src/main/java/eu/faircode/email/AdapterRule.java index 6ef28a1592..5949869166 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRule.java +++ b/app/src/main/java/eu/faircode/email/AdapterRule.java @@ -127,6 +127,9 @@ public class AdapterRule extends RecyclerView.Adapter { case EntityRule.TYPE_UNSEEN: tvAction.setText(R.string.title_rule_unseen); break; + case EntityRule.TYPE_IGNORE: + tvAction.setText(R.string.title_rule_ignore); + break; case EntityRule.TYPE_SNOOZE: tvAction.setText(R.string.title_rule_snooze); break; diff --git a/app/src/main/java/eu/faircode/email/EntityRule.java b/app/src/main/java/eu/faircode/email/EntityRule.java index 3e25cb4e66..48f47c4b7a 100644 --- a/app/src/main/java/eu/faircode/email/EntityRule.java +++ b/app/src/main/java/eu/faircode/email/EntityRule.java @@ -92,6 +92,7 @@ public class EntityRule { static final int TYPE_FLAG = 6; static final int TYPE_COPY = 7; static final int TYPE_SNOOZE = 8; + static final int TYPE_IGNORE = 9; static final String ACTION_AUTOMATION = BuildConfig.APPLICATION_ID + ".AUTOMATION"; static final String EXTRA_RULE = "rule"; @@ -266,6 +267,8 @@ public class EntityRule { return onActionSeen(context, message, true); case TYPE_UNSEEN: return onActionSeen(context, message, false); + case TYPE_IGNORE: + return onActionIgnore(context, message, jaction); case TYPE_SNOOZE: return onActionSnooze(context, message, jaction); case TYPE_FLAG: @@ -292,7 +295,15 @@ public class EntityRule { return true; } - private boolean onActionMove(Context context, EntityMessage message, JSONObject jargs) throws JSONException { + private boolean onActionIgnore(Context context, EntityMessage message, JSONObject jargs) { + DB db = DB.getInstance(context); + db.message().setMessageUiIgnored(message.id, true); + + message.ui_ignored = true; + return true; + } + + private boolean onActionMove(Context context, EntityMessage message, JSONObject jargs) { long target = jargs.optLong("target", -1); boolean seen = jargs.optBoolean("seen"); boolean thread = jargs.optBoolean("thread"); diff --git a/app/src/main/java/eu/faircode/email/FragmentRule.java b/app/src/main/java/eu/faircode/email/FragmentRule.java index c4c221813f..7e3c3c8b63 100644 --- a/app/src/main/java/eu/faircode/email/FragmentRule.java +++ b/app/src/main/java/eu/faircode/email/FragmentRule.java @@ -329,6 +329,7 @@ public class FragmentRule extends FragmentBase { List actions = new ArrayList<>(); actions.add(new Action(EntityRule.TYPE_SEEN, getString(R.string.title_rule_seen))); actions.add(new Action(EntityRule.TYPE_UNSEEN, getString(R.string.title_rule_unseen))); + actions.add(new Action(EntityRule.TYPE_IGNORE, getString(R.string.title_rule_ignore))); actions.add(new Action(EntityRule.TYPE_SNOOZE, getString(R.string.title_rule_snooze))); actions.add(new Action(EntityRule.TYPE_FLAG, getString(R.string.title_rule_flag))); actions.add(new Action(EntityRule.TYPE_MOVE, getString(R.string.title_rule_move))); diff --git a/app/src/main/res/values/strings.xml b/app/src/main/res/values/strings.xml index 581ff796ca..8315c99411 100644 --- a/app/src/main/res/values/strings.xml +++ b/app/src/main/res/values/strings.xml @@ -651,6 +651,7 @@ Mark read Mark unread + Suppress notification Snooze Add star Move