Added option to disable reply/forward rule checks

pull/217/head
M66B 10 months ago
parent b94cf503cd
commit 616d3b57e8

@ -1010,9 +1010,10 @@ public class EntityRule {
boolean resend = jargs.optBoolean("resend"); boolean resend = jargs.optBoolean("resend");
boolean attached = jargs.optBoolean("attached"); boolean attached = jargs.optBoolean("attached");
boolean attachments = jargs.optBoolean("attachments"); boolean attachments = jargs.optBoolean("attachments");
boolean checks = jargs.optBoolean("checks", true);
if (TextUtils.isEmpty(to)) { if (TextUtils.isEmpty(to)) {
if (Boolean.TRUE.equals(message.auto_submitted)) { if (checks && Boolean.TRUE.equals(message.auto_submitted)) {
EntityLog.log(context, EntityLog.Type.Rules, message, "Auto submitted rule=" + name); EntityLog.log(context, EntityLog.Type.Rules, message, "Auto submitted rule=" + name);
return false; return false;
} }
@ -1023,7 +1024,7 @@ public class EntityRule {
return false; return false;
} }
if (MessageHelper.isNoReply(recipients)) { if (checks && MessageHelper.isNoReply(recipients)) {
EntityLog.log(context, EntityLog.Type.Rules, message, "No-reply rule=" + name); EntityLog.log(context, EntityLog.Type.Rules, message, "No-reply rule=" + name);
return false; return false;
} }

@ -167,6 +167,7 @@ public class FragmentRule extends FragmentBase {
private CheckBox cbResend; private CheckBox cbResend;
private CheckBox cbAttached; private CheckBox cbAttached;
private CheckBox cbCc; private CheckBox cbCc;
private CheckBox cbChecks;
private Button btnTtsSetup; private Button btnTtsSetup;
private Button btnTtsData; private Button btnTtsData;
@ -372,6 +373,7 @@ public class FragmentRule extends FragmentBase {
cbResend = view.findViewById(R.id.cbResend); cbResend = view.findViewById(R.id.cbResend);
cbAttached = view.findViewById(R.id.cbAttached); cbAttached = view.findViewById(R.id.cbAttached);
cbCc = view.findViewById(R.id.cbCc); cbCc = view.findViewById(R.id.cbCc);
cbChecks = view.findViewById(R.id.cbChecks);
btnTtsSetup = view.findViewById(R.id.btnTtsSetup); btnTtsSetup = view.findViewById(R.id.btnTtsSetup);
btnTtsData = view.findViewById(R.id.btnTtsData); btnTtsData = view.findViewById(R.id.btnTtsData);
@ -1446,6 +1448,7 @@ public class FragmentRule extends FragmentBase {
cbResend.setChecked(jaction.optBoolean("resend")); cbResend.setChecked(jaction.optBoolean("resend"));
cbAttached.setChecked(jaction.optBoolean("attached")); cbAttached.setChecked(jaction.optBoolean("attached"));
cbCc.setChecked(jaction.optBoolean("cc")); cbCc.setChecked(jaction.optBoolean("cc"));
cbChecks.setChecked(jaction.optBoolean("checks", true));
break; break;
case EntityRule.TYPE_SOUND: case EntityRule.TYPE_SOUND:
@ -1876,6 +1879,7 @@ public class FragmentRule extends FragmentBase {
jaction.put("resend", cbResend.isChecked()); jaction.put("resend", cbResend.isChecked());
jaction.put("attached", cbAttached.isChecked()); jaction.put("attached", cbAttached.isChecked());
jaction.put("cc", cbCc.isChecked()); jaction.put("cc", cbCc.isChecked());
jaction.put("checks", cbChecks.isChecked());
break; break;
case EntityRule.TYPE_SOUND: case EntityRule.TYPE_SOUND:

@ -1236,6 +1236,16 @@
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbAttached" /> app:layout_constraintTop_toBottomOf="@id/cbAttached" />
<CheckBox
android:id="@+id/cbChecks"
android:layout_width="wrap_content"
android:layout_height="wrap_content"
android:layout_marginTop="12dp"
android:checked="true"
android:text="@string/title_rule_checks"
app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbCc" />
<TextView <TextView
android:id="@+id/tvAnswerRemark" android:id="@+id/tvAnswerRemark"
android:layout_width="0dp" android:layout_width="0dp"
@ -1245,7 +1255,7 @@
android:textAppearance="@style/TextAppearance.AppCompat.Small" android:textAppearance="@style/TextAppearance.AppCompat.Small"
android:textStyle="italic" android:textStyle="italic"
app:layout_constraintStart_toStartOf="parent" app:layout_constraintStart_toStartOf="parent"
app:layout_constraintTop_toBottomOf="@id/cbCc" /> app:layout_constraintTop_toBottomOf="@id/cbChecks" />
<Button <Button
android:id="@+id/btnTtsSetup" android:id="@+id/btnTtsSetup"
@ -1526,7 +1536,7 @@
android:id="@+id/grpAnswer" android:id="@+id/grpAnswer"
android:layout_width="0dp" android:layout_width="0dp"
android:layout_height="0dp" android:layout_height="0dp"
app:constraint_referenced_ids="tvAnswerIdentity,spIdent,tvAnswerTemplate,spAnswer,cbAnswerSubject,cbOriginalText,cbWithAttachments,tvTo,etTo,ibTo,cbResend,cbAttached,cbCc,tvAnswerRemark" /> app:constraint_referenced_ids="tvAnswerIdentity,spIdent,tvAnswerTemplate,spAnswer,cbAnswerSubject,cbOriginalText,cbWithAttachments,tvTo,etTo,ibTo,cbResend,cbAttached,cbCc,cbChecks,tvAnswerRemark" />
<androidx.constraintlayout.widget.Group <androidx.constraintlayout.widget.Group
android:id="@+id/grpTts" android:id="@+id/grpTts"

@ -2144,6 +2144,7 @@
<string name="title_rule_resend">Resend</string> <string name="title_rule_resend">Resend</string>
<string name="title_rule_attached">Attach raw message file</string> <string name="title_rule_attached">Attach raw message file</string>
<string name="title_rule_cc">Reply to CC addresses</string> <string name="title_rule_cc">Reply to CC addresses</string>
<string name="title_rule_checks">Check for no-reply addresses, etc.</string>
<string name="title_rule_with_attachments">With attachments</string> <string name="title_rule_with_attachments">With attachments</string>
<string name="title_rule_answer_remark">Only one reply will be sent for any conversation, to avoid reply loops</string> <string name="title_rule_answer_remark">Only one reply will be sent for any conversation, to avoid reply loops</string>
<string name="title_rule_name_missing">Rule name missing</string> <string name="title_rule_name_missing">Rule name missing</string>

Loading…
Cancel
Save