Added rule action option to include message text

This commit is contained in:
M66B
2022-02-11 11:30:30 +01:00
parent 6943a7a250
commit 9a1c3b04fe
4 changed files with 37 additions and 17 deletions

View File

@@ -140,6 +140,7 @@ public class FragmentRule extends FragmentBase {
private Spinner spIdent;
private Spinner spAnswer;
private CheckBox cbIncludeMessageText;
private EditText etTo;
private ImageButton ibTo;
private CheckBox cbCc;
@@ -290,6 +291,7 @@ public class FragmentRule extends FragmentBase {
spIdent = view.findViewById(R.id.spIdent);
spAnswer = view.findViewById(R.id.spAnswer);
cbIncludeMessageText = view.findViewById(R.id.cbIncludeMessageText);
etTo = view.findViewById(R.id.etTo);
ibTo = view.findViewById(R.id.ibTo);
cbCc = view.findViewById(R.id.cbCc);
@@ -1137,6 +1139,8 @@ public class FragmentRule extends FragmentBase {
break;
}
cbIncludeMessageText.setChecked(jaction.optBoolean("text", true));
etTo.setText(jaction.optString("to"));
cbCc.setChecked(jaction.optBoolean("cc"));
cbWithAttachments.setChecked(jaction.optBoolean("attachments"));
@@ -1477,6 +1481,7 @@ public class FragmentRule extends FragmentBase {
EntityAnswer answer = (EntityAnswer) spAnswer.getSelectedItem();
jaction.put("identity", identity == null ? -1 : identity.id);
jaction.put("answer", answer == null || answer.id == null ? -1 : answer.id);
jaction.put("text", cbIncludeMessageText.isChecked());
jaction.put("to", etTo.getText().toString().trim());
jaction.put("cc", cbCc.isChecked());
jaction.put("attachments", cbWithAttachments.isChecked());