mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-31 20:25:38 +00:00
Prevent too long \Delete command
This commit is contained in:
parent
0e489ccf14
commit
e8eb733303
2 changed files with 11 additions and 5 deletions
|
@ -137,7 +137,7 @@ import javax.mail.search.SentDateTerm;
|
||||||
import me.leolin.shortcutbadger.ShortcutBadger;
|
import me.leolin.shortcutbadger.ShortcutBadger;
|
||||||
|
|
||||||
class Core {
|
class Core {
|
||||||
static final int DEFAULT_SYNC_CHUNCK_SIZE = 100;
|
static final int DEFAULT_CHUNCK_SIZE = 100;
|
||||||
|
|
||||||
private static final int MAX_NOTIFICATION_DISPLAY = 10; // per group
|
private static final int MAX_NOTIFICATION_DISPLAY = 10; // per group
|
||||||
private static final int MAX_NOTIFICATION_COUNT = 100; // per group
|
private static final int MAX_NOTIFICATION_COUNT = 100; // per group
|
||||||
|
@ -2394,8 +2394,14 @@ class Core {
|
||||||
if (account.isYahooJp()) {
|
if (account.isYahooJp()) {
|
||||||
for (Message imessage : idelete)
|
for (Message imessage : idelete)
|
||||||
imessage.setFlag(Flags.Flag.DELETED, true);
|
imessage.setFlag(Flags.Flag.DELETED, true);
|
||||||
} else
|
} else {
|
||||||
ifolder.setFlags(idelete.toArray(new Message[0]), new Flags(Flags.Flag.DELETED), true);
|
SharedPreferences prefs = PreferenceManager.getDefaultSharedPreferences(context);
|
||||||
|
int chunk_size = prefs.getInt("chunk_size", DEFAULT_CHUNCK_SIZE);
|
||||||
|
|
||||||
|
Flags flags = new Flags(Flags.Flag.DELETED);
|
||||||
|
for (List<Message> list : Helper.chunkList(idelete, chunk_size))
|
||||||
|
ifolder.setFlags(list.toArray(new Message[0]), flags, true);
|
||||||
|
}
|
||||||
Log.i(folder.name + " purge deleted");
|
Log.i(folder.name + " purge deleted");
|
||||||
expunge(context, ifolder, idelete);
|
expunge(context, ifolder, idelete);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
|
@ -3118,7 +3124,7 @@ class Core {
|
||||||
ranges.add(new Pair<>(first, last < 0 ? first : last));
|
ranges.add(new Pair<>(first, last < 0 ? first : last));
|
||||||
|
|
||||||
// https://datatracker.ietf.org/doc/html/rfc2683#section-3.2.1.5
|
// https://datatracker.ietf.org/doc/html/rfc2683#section-3.2.1.5
|
||||||
int chunk_size = prefs.getInt("chunk_size", DEFAULT_SYNC_CHUNCK_SIZE);
|
int chunk_size = prefs.getInt("chunk_size", DEFAULT_CHUNCK_SIZE);
|
||||||
if (chunk_size < 200 &&
|
if (chunk_size < 200 &&
|
||||||
(account.isGmail() || account.isOutlook()))
|
(account.isGmail() || account.isOutlook()))
|
||||||
chunk_size = 200;
|
chunk_size = 200;
|
||||||
|
|
|
@ -1332,7 +1332,7 @@ public class FragmentOptionsMisc extends FragmentBase implements SharedPreferenc
|
||||||
Helper.humanReadableByteCount(cache_size * 1024L)));
|
Helper.humanReadableByteCount(cache_size * 1024L)));
|
||||||
sbSqliteCache.setProgress(sqlite_cache);
|
sbSqliteCache.setProgress(sqlite_cache);
|
||||||
|
|
||||||
int chunk_size = prefs.getInt("chunk_size", Core.DEFAULT_SYNC_CHUNCK_SIZE);
|
int chunk_size = prefs.getInt("chunk_size", Core.DEFAULT_CHUNCK_SIZE);
|
||||||
tvChunkSize.setText(getString(R.string.title_advanced_chunk_size, chunk_size));
|
tvChunkSize.setText(getString(R.string.title_advanced_chunk_size, chunk_size));
|
||||||
sbChunkSize.setProgress(chunk_size);
|
sbChunkSize.setProgress(chunk_size);
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue