From 200ff5b51c859217d7a86f5b42dfbcaa6d49aeba Mon Sep 17 00:00:00 2001 From: M66B Date: Fri, 1 Apr 2022 12:32:53 +0200 Subject: [PATCH] Show rule action forward address --- app/src/main/java/eu/faircode/email/AdapterRule.java | 11 ++++++++--- 1 file changed, 8 insertions(+), 3 deletions(-) diff --git a/app/src/main/java/eu/faircode/email/AdapterRule.java b/app/src/main/java/eu/faircode/email/AdapterRule.java index 43d357bb91..ac1cdf4095 100644 --- a/app/src/main/java/eu/faircode/email/AdapterRule.java +++ b/app/src/main/java/eu/faircode/email/AdapterRule.java @@ -166,6 +166,8 @@ public class AdapterRule extends RecyclerView.Adapter { try { JSONObject jaction = new JSONObject(rule.action); + + String to = null; int type = jaction.getInt("type"); if (type == EntityRule.TYPE_SNOOZE) { int duration = jaction.optInt("duration", 0); @@ -184,12 +186,15 @@ public class AdapterRule extends RecyclerView.Adapter { setAction(type, value); } else if (type == EntityRule.TYPE_KEYWORD) { setAction(type, jaction.optString("keyword")); + } else if (type == EntityRule.TYPE_ANSWER) { + to = jaction.optString("to"); + if (!TextUtils.isEmpty(to)) + setAction(type, to); } else setAction(type, null); - if (type == EntityRule.TYPE_ANSWER || - type == EntityRule.TYPE_MOVE || - type == EntityRule.TYPE_COPY) { + if (type == EntityRule.TYPE_MOVE || type == EntityRule.TYPE_COPY || + (type == EntityRule.TYPE_ANSWER && TextUtils.isEmpty(to))) { Bundle args = new Bundle(); args.putLong("id", rule.id); args.putInt("type", type);