diff --git a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java index b4bddb3ae4..752ed6f3fb 100644 --- a/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java +++ b/app/src/main/java/eu/faircode/email/FragmentOptionsMisc.java @@ -114,7 +114,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private SwitchCompat swSortAnswers; private SwitchCompat swExternalAnswer; private SwitchCompat swShortcuts; - private SwitchCompat swICalTentative; private SwitchCompat swFts; private SwitchCompat swClassification; private TextView tvClassMinProbability; @@ -292,7 +291,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc private static final long MIN_FILE_SIZE = 1024 * 1024L; private final static String[] RESET_OPTIONS = new String[]{ - "sort_answers", "shortcuts", "ical_tentative", "fts", + "sort_answers", "shortcuts", "fts", "classification", "class_min_probability", "class_min_difference", "show_filtered", "language", @@ -382,7 +381,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swSortAnswers = view.findViewById(R.id.swSortAnswers); swExternalAnswer = view.findViewById(R.id.swExternalAnswer); swShortcuts = view.findViewById(R.id.swShortcuts); - swICalTentative = view.findViewById(R.id.swICalTentative); swFts = view.findViewById(R.id.swFts); swClassification = view.findViewById(R.id.swClassification); ibClassification = view.findViewById(R.id.ibClassification); @@ -610,14 +608,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc } }); - swICalTentative.setVisibility(BuildConfig.PLAY_STORE_RELEASE ? View.GONE : View.VISIBLE); - swICalTentative.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { - @Override - public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { - prefs.edit().putBoolean("ical_tentative", checked).apply(); // apply won't work here - } - }); - swFts.setOnCheckedChangeListener(new CompoundButton.OnCheckedChangeListener() { @Override public void onCheckedChanged(CompoundButton compoundButton, boolean checked) { @@ -2607,7 +2597,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc swExternalSearch.setChecked(Helper.isComponentEnabled(getContext(), ActivitySearch.class)); swExternalAnswer.setChecked(Helper.isComponentEnabled(getContext(), ActivityAnswer.class)); swShortcuts.setChecked(prefs.getBoolean("shortcuts", true)); - swICalTentative.setChecked(prefs.getBoolean("ical_tentative", true)); swFts.setChecked(prefs.getBoolean("fts", false)); swClassification.setChecked(prefs.getBoolean("classification", false)); diff --git a/app/src/main/java/eu/faircode/email/MessageHelper.java b/app/src/main/java/eu/faircode/email/MessageHelper.java index 1f99463d05..fe3fb534a0 100644 --- a/app/src/main/java/eu/faircode/email/MessageHelper.java +++ b/app/src/main/java/eu/faircode/email/MessageHelper.java @@ -159,7 +159,6 @@ import biweekly.Biweekly; import biweekly.ICalendar; import biweekly.component.VEvent; import biweekly.property.Method; -import biweekly.property.Status; import ezvcard.VCard; import ezvcard.VCardVersion; import ezvcard.io.text.VCardWriter; @@ -4417,9 +4416,6 @@ public class MessageHelper { private void decodeICalendar(Context context, EntityAttachment local) { DB db = DB.getInstance(context); try { - SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context); - boolean ical_tentative = prefs.getBoolean("ical_tentative", true); - boolean permission = Helper.hasPermission(context, Manifest.permission.WRITE_CALENDAR); EntityMessage message = db.message().getMessage(local.message); @@ -4451,21 +4447,6 @@ public class MessageHelper { if (method != null && method.isCancel()) CalendarHelper.delete(context, event, message); else if (method == null || method.isRequest() || method.isReply()) { - int status = CalendarContract.Events.STATUS_TENTATIVE; - if (method != null && method.isReply()) { - Status istatus = event.getStatus(); - if (istatus != null) - if (Status.ACCEPTED.equals(istatus.getValue())) - status = CalendarContract.Events.STATUS_CONFIRMED; - else if (Status.CANCELLED.equals(istatus.getValue())) - status = CalendarContract.Events.STATUS_CANCELED; - } - - if (status == CalendarContract.Events.STATUS_TENTATIVE && !ical_tentative) { - EntityLog.log(context, "Tentative event not processed"); - return; - } - String selectedAccount; String selectedName; try { @@ -4478,7 +4459,9 @@ public class MessageHelper { selectedName = null; } - CalendarHelper.insert(context, icalendar, event, status, selectedAccount, selectedName, message); + CalendarHelper.insert(context, icalendar, event, + CalendarContract.Events.STATUS_TENTATIVE, + selectedAccount, selectedName, message); } else EntityLog.log(context, "Unknown event method=" + method.getValue()); } catch (Throwable ex) { diff --git a/app/src/main/res/layout/fragment_options_misc.xml b/app/src/main/res/layout/fragment_options_misc.xml index 5ac084ce9e..eaa101f50b 100644 --- a/app/src/main/res/layout/fragment_options_misc.xml +++ b/app/src/main/res/layout/fragment_options_misc.xml @@ -156,18 +156,6 @@ app:layout_constraintStart_toStartOf="parent" app:layout_constraintTop_toBottomOf="@id/swShortcuts" /> - - Sort reply templates by frequency of use Provide reply templates to other apps Show frequently used contacts in Android share menu - Store received invitations as tentative Build search index %1$d / %2$d messages indexed (%3$s) Classify messages