mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 01:36:55 +00:00
Limit small message size
This commit is contained in:
parent
c8864d08d3
commit
0b7918a077
2 changed files with 4 additions and 3 deletions
|
@ -2845,11 +2845,11 @@ class Core {
|
|||
if (download && message.size != null && !message.ui_hide) {
|
||||
long maxSize;
|
||||
if (state == null || state.networkState.isUnmetered())
|
||||
maxSize = MessageHelper.DEFAULT_DOWNLOAD_SIZE;
|
||||
maxSize = MessageHelper.SMALL_MESSAGE_SIZE;
|
||||
else {
|
||||
maxSize = prefs.getInt("download", MessageHelper.DEFAULT_DOWNLOAD_SIZE);
|
||||
if (maxSize == 0)
|
||||
maxSize = MessageHelper.DEFAULT_DOWNLOAD_SIZE;
|
||||
if (maxSize == 0 || maxSize > MessageHelper.SMALL_MESSAGE_SIZE)
|
||||
maxSize = MessageHelper.SMALL_MESSAGE_SIZE;
|
||||
}
|
||||
|
||||
if (message.size < maxSize) {
|
||||
|
|
|
@ -113,6 +113,7 @@ public class MessageHelper {
|
|||
|
||||
private static File cacheDir = null;
|
||||
|
||||
static final int SMALL_MESSAGE_SIZE = 192 * 1024; // bytes
|
||||
static final int DEFAULT_DOWNLOAD_SIZE = 256 * 1024; // bytes
|
||||
static final String HEADER_CORRELATION_ID = "X-Correlation-ID";
|
||||
|
||||
|
|
Loading…
Reference in a new issue