mirror of
https://github.com/M66B/FairEmail.git
synced 2026-03-30 05:44:51 +02:00
Limit rule/notes length
This commit is contained in:
@@ -138,6 +138,7 @@ public class EntityRule {
|
||||
|
||||
static final String JSOUP_PREFIX = "jsoup:";
|
||||
private static final long SEND_DELAY = 5000L; // milliseconds
|
||||
private static final int MAX_NOTES_LENGTH = 512; // characters
|
||||
|
||||
static boolean needsHeaders(EntityMessage message, List<EntityRule> rules) {
|
||||
return needs(rules, "header");
|
||||
@@ -1347,6 +1348,11 @@ public class EntityRule {
|
||||
}
|
||||
}
|
||||
|
||||
if (TextUtils.isEmpty(notes))
|
||||
notes = null;
|
||||
else if (notes.length() > MAX_NOTES_LENGTH)
|
||||
notes = notes.substring(0, MAX_NOTES_LENGTH);
|
||||
|
||||
DB db = DB.getInstance(context);
|
||||
db.message().setMessageNotes(message.id, notes, color);
|
||||
|
||||
|
||||
Reference in New Issue
Block a user