Added rule noop

pull/162/head
M66B 5 years ago
parent 9f1dfac07a
commit 43612ecd2b

@ -121,6 +121,9 @@ public class AdapterRule extends RecyclerView.Adapter<AdapterRule.ViewHolder> {
JSONObject jaction = new JSONObject(rule.action);
int type = jaction.getInt("type");
switch (type) {
case EntityRule.TYPE_NOOP:
tvAction.setText(R.string.title_rule_noop);
break;
case EntityRule.TYPE_SEEN:
tvAction.setText(R.string.title_rule_seen);
break;

@ -94,6 +94,7 @@ public class EntityRule {
static final int TYPE_COPY = 7;
static final int TYPE_SNOOZE = 8;
static final int TYPE_IGNORE = 9;
static final int TYPE_NOOP = 10;
static final String ACTION_AUTOMATION = BuildConfig.APPLICATION_ID + ".AUTOMATION";
static final String EXTRA_RULE = "rule";
@ -265,6 +266,8 @@ public class EntityRule {
Log.i("Executing rule=" + type + ":" + name + " message=" + message.id);
switch (type) {
case TYPE_NOOP:
return true;
case TYPE_SEEN:
return onActionSeen(context, message, true);
case TYPE_UNSEEN:

@ -319,6 +319,7 @@ public class FragmentRule extends FragmentBase {
});
List<Action> actions = new ArrayList<>();
actions.add(new Action(EntityRule.TYPE_NOOP, getString(R.string.title_rule_noop)));
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)));

@ -666,6 +666,7 @@
<string name="title_answer_template_name">$name$ will be replaced by the sender full name</string>
<string name="title_answer_template_email">$email$ will be replaced by the sender email address</string>
<string name="title_rule_noop">No action</string>
<string name="title_rule_seen">Mark read</string>
<string name="title_rule_unseen">Mark unread</string>
<string name="title_rule_ignore">Suppress notification</string>

Loading…
Cancel
Save