mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-24 15:11:03 +00:00
Rule improvements
This commit is contained in:
parent
84895b6077
commit
7f2b54f28b
3 changed files with 17 additions and 3 deletions
|
@ -192,6 +192,6 @@ public class EntityIdentity {
|
||||||
@NonNull
|
@NonNull
|
||||||
@Override
|
@Override
|
||||||
public String toString() {
|
public String toString() {
|
||||||
return getDisplayName() + (primary ? " ★" : "");
|
return getDisplayName() + " <" + email + ">" + (primary ? " ★" : "");
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
@ -48,6 +48,7 @@ import androidx.annotation.NonNull;
|
||||||
import androidx.annotation.Nullable;
|
import androidx.annotation.Nullable;
|
||||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||||
import androidx.constraintlayout.widget.Group;
|
import androidx.constraintlayout.widget.Group;
|
||||||
|
import androidx.fragment.app.FragmentTransaction;
|
||||||
|
|
||||||
public class FragmentRule extends FragmentBase {
|
public class FragmentRule extends FragmentBase {
|
||||||
private ViewGroup view;
|
private ViewGroup view;
|
||||||
|
@ -270,7 +271,13 @@ public class FragmentRule extends FragmentBase {
|
||||||
etHeader.setText(jheader == null ? null : jheader.getString("value"));
|
etHeader.setText(jheader == null ? null : jheader.getString("value"));
|
||||||
cbHeader.setChecked(jheader != null && jheader.getBoolean("regex"));
|
cbHeader.setChecked(jheader != null && jheader.getBoolean("regex"));
|
||||||
|
|
||||||
if (rule != null) {
|
if (rule == null) {
|
||||||
|
for (int pos = 0; pos < adapterIdentity.getCount(); pos++)
|
||||||
|
if (adapterIdentity.getItem(pos).primary) {
|
||||||
|
spIdent.setSelection(pos);
|
||||||
|
break;
|
||||||
|
}
|
||||||
|
} else {
|
||||||
int type = jaction.getInt("type");
|
int type = jaction.getInt("type");
|
||||||
switch (type) {
|
switch (type) {
|
||||||
case EntityRule.TYPE_MOVE:
|
case EntityRule.TYPE_MOVE:
|
||||||
|
@ -376,6 +383,13 @@ public class FragmentRule extends FragmentBase {
|
||||||
}
|
}
|
||||||
|
|
||||||
private void onActionSave() {
|
private void onActionSave() {
|
||||||
|
if (!Helper.isPro(getContext())) {
|
||||||
|
FragmentTransaction fragmentTransaction = getFragmentManager().beginTransaction();
|
||||||
|
fragmentTransaction.replace(R.id.content_frame, new FragmentPro()).addToBackStack("pro");
|
||||||
|
fragmentTransaction.commit();
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
try {
|
try {
|
||||||
Helper.setViewsEnabled(view, false);
|
Helper.setViewsEnabled(view, false);
|
||||||
|
|
||||||
|
|
|
@ -2615,7 +2615,7 @@ public class ServiceSynchronize extends LifecycleService {
|
||||||
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(fkeywords.toArray(new String[0])));
|
db.folder().setFolderKeywords(folder.id, DB.Converters.fromStringArray(fkeywords.toArray(new String[0])));
|
||||||
}
|
}
|
||||||
|
|
||||||
if (filter)
|
if (filter && Helper.isPro(context))
|
||||||
try {
|
try {
|
||||||
for (EntityRule rule : rules)
|
for (EntityRule rule : rules)
|
||||||
if (rule.matches(context, message, imessage)) {
|
if (rule.matches(context, message, imessage)) {
|
||||||
|
|
Loading…
Reference in a new issue