mirror of
https://github.com/M66B/FairEmail.git
synced 2025-02-23 22:51:02 +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
|
||||
@Override
|
||||
public String toString() {
|
||||
return getDisplayName() + (primary ? " ★" : "");
|
||||
return getDisplayName() + " <" + email + ">" + (primary ? " ★" : "");
|
||||
}
|
||||
}
|
||||
|
|
|
@ -48,6 +48,7 @@ import androidx.annotation.NonNull;
|
|||
import androidx.annotation.Nullable;
|
||||
import androidx.constraintlayout.widget.ConstraintLayout;
|
||||
import androidx.constraintlayout.widget.Group;
|
||||
import androidx.fragment.app.FragmentTransaction;
|
||||
|
||||
public class FragmentRule extends FragmentBase {
|
||||
private ViewGroup view;
|
||||
|
@ -270,7 +271,13 @@ public class FragmentRule extends FragmentBase {
|
|||
etHeader.setText(jheader == null ? null : jheader.getString("value"));
|
||||
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");
|
||||
switch (type) {
|
||||
case EntityRule.TYPE_MOVE:
|
||||
|
@ -376,6 +383,13 @@ public class FragmentRule extends FragmentBase {
|
|||
}
|
||||
|
||||
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 {
|
||||
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])));
|
||||
}
|
||||
|
||||
if (filter)
|
||||
if (filter && Helper.isPro(context))
|
||||
try {
|
||||
for (EntityRule rule : rules)
|
||||
if (rule.matches(context, message, imessage)) {
|
||||
|
|
Loading…
Reference in a new issue