mirror of
https://github.com/M66B/FairEmail.git
synced 2024-12-26 17:57:16 +00:00
Truncate preview texts
This commit is contained in:
parent
62ff5f651f
commit
6247d62531
1 changed files with 3 additions and 0 deletions
|
@ -145,6 +145,7 @@ class Core {
|
||||||
private static final int LOCAL_RETRY_MAX = 2;
|
private static final int LOCAL_RETRY_MAX = 2;
|
||||||
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds
|
private static final long LOCAL_RETRY_DELAY = 5 * 1000L; // milliseconds
|
||||||
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
|
private static final int TOTAL_RETRY_MAX = LOCAL_RETRY_MAX * 5;
|
||||||
|
private static final int MAX_PREVIEW = 5000; // characters
|
||||||
|
|
||||||
static void processOperations(
|
static void processOperations(
|
||||||
Context context,
|
Context context,
|
||||||
|
@ -3952,6 +3953,8 @@ class Core {
|
||||||
try {
|
try {
|
||||||
File file = message.getFile(context);
|
File file = message.getFile(context);
|
||||||
preview = HtmlHelper.getFullText(file);
|
preview = HtmlHelper.getFullText(file);
|
||||||
|
if (preview != null && preview.length() > MAX_PREVIEW)
|
||||||
|
preview = preview.substring(0, MAX_PREVIEW);
|
||||||
} catch (Throwable ex) {
|
} catch (Throwable ex) {
|
||||||
Log.e(ex);
|
Log.e(ex);
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in a new issue