mirror of
https://github.com/M66B/FairEmail.git
synced 2025-03-04 10:39:25 +00:00
Outlook warning one month in advance
This commit is contained in:
parent
7216e1cd57
commit
d13f8f3e02
2 changed files with 12 additions and 13 deletions
|
@ -4796,6 +4796,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
cal.set(Calendar.MONTH, Calendar.MAY);
|
||||
cal.set(Calendar.YEAR, 2022);
|
||||
|
||||
long now = new Date().getTime();
|
||||
if (now < cal.getTimeInMillis() - 30 * 24 * 3600 * 1000L)
|
||||
return false; // Not yet
|
||||
|
||||
if (Helper.getInstallTime(context) > cal.getTimeInMillis()) {
|
||||
prefs.edit().putBoolean("gmail_checked", true).apply();
|
||||
return false;
|
||||
|
@ -4803,7 +4807,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
cal.add(Calendar.MONTH, 2);
|
||||
|
||||
long now = new Date().getTime();
|
||||
if (now > cal.getTimeInMillis()) {
|
||||
prefs.edit().putBoolean("gmail_checked", true).apply();
|
||||
return false;
|
||||
|
@ -4865,13 +4868,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
}
|
||||
|
||||
private boolean checkOutlook() {
|
||||
if (!BuildConfig.DEBUG)
|
||||
return false;
|
||||
|
||||
final Context context = getContext();
|
||||
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||
if (prefs.getBoolean("outlook_checked", false))
|
||||
return false;
|
||||
//if (prefs.getBoolean("outlook_checked", false))
|
||||
// return false;
|
||||
|
||||
Calendar cal = Calendar.getInstance();
|
||||
cal.set(Calendar.MILLISECOND, 0);
|
||||
|
@ -4882,6 +4882,10 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
cal.set(Calendar.MONTH, Calendar.OCTOBER);
|
||||
cal.set(Calendar.YEAR, 2022);
|
||||
|
||||
long now = new Date().getTime();
|
||||
if (now < cal.getTimeInMillis() - 30 * 24 * 3600 * 1000L)
|
||||
return false; // Not yet
|
||||
|
||||
if (Helper.getInstallTime(context) > cal.getTimeInMillis()) {
|
||||
prefs.edit().putBoolean("outlook_checked", true).apply();
|
||||
return false;
|
||||
|
@ -4889,7 +4893,6 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences.
|
|||
|
||||
cal.add(Calendar.MONTH, 2);
|
||||
|
||||
long now = new Date().getTime();
|
||||
if (now > cal.getTimeInMillis()) {
|
||||
prefs.edit().putBoolean("outlook_checked", true).apply();
|
||||
return false;
|
||||
|
|
|
@ -241,7 +241,8 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
"signature_images_hint",
|
||||
"gmail_checked",
|
||||
"eml_auto_confirm",
|
||||
"open_with_pkg", "open_with_tabs"
|
||||
"open_with_pkg", "open_with_tabs",
|
||||
"gmail_checked", "outlook_checked"
|
||||
};
|
||||
|
||||
@Override
|
||||
|
@ -1621,11 +1622,6 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
|||
editor.remove(key);
|
||||
}
|
||||
|
||||
if (BuildConfig.DEBUG) {
|
||||
editor.remove("gmail_checked");
|
||||
editor.remove("outlook_checked");
|
||||
}
|
||||
|
||||
editor.apply();
|
||||
|
||||
ToastEx.makeText(context, R.string.title_setup_done, Toast.LENGTH_LONG).show();
|
||||
|
|
Loading…
Add table
Reference in a new issue