diff --git a/app/src/main/java/eu/faircode/email/FragmentAccounts.java b/app/src/main/java/eu/faircode/email/FragmentAccounts.java index b9b3924587..d4cfbd72c9 100644 --- a/app/src/main/java/eu/faircode/email/FragmentAccounts.java +++ b/app/src/main/java/eu/faircode/email/FragmentAccounts.java @@ -325,7 +325,7 @@ public class FragmentAccounts extends FragmentBase { } private void onMenuForceSync() { - ServiceSynchronize.reload(getContext(), null, true, "force sync"); + refresh(true); ToastEx.makeText(getContext(), R.string.title_executing, Toast.LENGTH_LONG).show(); } @@ -339,7 +339,12 @@ public class FragmentAccounts extends FragmentBase { } private void onSwipeRefresh() { + refresh(false); + } + + private void refresh(boolean force) { Bundle args = new Bundle(); + args.putBoolean("force", force); new SimpleTask() { @Override @@ -353,7 +358,7 @@ public class FragmentAccounts extends FragmentBase { throw new IllegalStateException(context.getString(R.string.title_no_internet)); boolean now = true; - boolean force = false; + boolean force = args.getBoolean("force"); boolean outbox = false; DB db = DB.getInstance(context); diff --git a/app/src/main/java/eu/faircode/email/FragmentFolders.java b/app/src/main/java/eu/faircode/email/FragmentFolders.java index c1e78c7d26..c909224eef 100644 --- a/app/src/main/java/eu/faircode/email/FragmentFolders.java +++ b/app/src/main/java/eu/faircode/email/FragmentFolders.java @@ -347,9 +347,14 @@ public class FragmentFolders extends FragmentBase { } private void onSwipeRefresh() { + refresh(false); + } + + private void refresh(boolean force) { Bundle args = new Bundle(); args.putLong("account", account); args.putBoolean("primary", primary); + args.putBoolean("force", force); new SimpleTask() { @Override @@ -366,7 +371,7 @@ public class FragmentFolders extends FragmentBase { throw new IllegalStateException(context.getString(R.string.title_no_internet)); boolean now = true; - boolean force = false; + boolean force = args.getBoolean("force"); boolean outbox = false; DB db = DB.getInstance(context); @@ -593,7 +598,7 @@ public class FragmentFolders extends FragmentBase { } private void onMenuForceSync() { - ServiceSynchronize.reload(getContext(), null, true, "force sync"); + refresh(true); ToastEx.makeText(getContext(), R.string.title_executing, Toast.LENGTH_LONG).show(); } diff --git a/app/src/main/java/eu/faircode/email/FragmentMessages.java b/app/src/main/java/eu/faircode/email/FragmentMessages.java index 867d42cdef..38686a8639 100644 --- a/app/src/main/java/eu/faircode/email/FragmentMessages.java +++ b/app/src/main/java/eu/faircode/email/FragmentMessages.java @@ -1541,10 +1541,14 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. private void onSwipeRefresh() { swipeRefresh.onRefresh(); + refresh(false); + } + private void refresh(boolean force) { Bundle args = new Bundle(); args.putLong("folder", folder); args.putString("type", type); + args.putBoolean("force", force); new SimpleTask() { @Override @@ -1556,7 +1560,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. throw new IllegalStateException(context.getString(R.string.title_no_internet)); boolean now = true; - boolean force = false; + boolean force = args.getBoolean("force"); DB db = DB.getInstance(context); try { @@ -4851,7 +4855,7 @@ public class FragmentMessages extends FragmentBase implements SharedPreferences. } private void onMenuForceSync() { - ServiceSynchronize.reload(getContext(), null, true, "force sync"); + refresh(true); ToastEx.makeText(getContext(), R.string.title_executing, Toast.LENGTH_LONG).show(); }