only store messages up to a length of 1M chars
This commit is contained in:
parent
6313c3c92e
commit
e35ada4997
|
@ -77,6 +77,7 @@ public final class Config {
|
||||||
public static final int REFRESH_UI_INTERVAL = 500;
|
public static final int REFRESH_UI_INTERVAL = 500;
|
||||||
|
|
||||||
public static final int MAX_DISPLAY_MESSAGE_CHARS = 4096;
|
public static final int MAX_DISPLAY_MESSAGE_CHARS = 4096;
|
||||||
|
public static final int MAX_STORAGE_MESSAGE_CHARS = 1024 * 1024 * 1024;
|
||||||
|
|
||||||
public static final long MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;
|
public static final long MILLISECONDS_IN_DAY = 24 * 60 * 60 * 1000;
|
||||||
|
|
||||||
|
|
|
@ -219,7 +219,7 @@ public class Message extends AbstractEntity {
|
||||||
} else {
|
} else {
|
||||||
values.put(TRUE_COUNTERPART, trueCounterpart.toPreppedString());
|
values.put(TRUE_COUNTERPART, trueCounterpart.toPreppedString());
|
||||||
}
|
}
|
||||||
values.put(BODY, body);
|
values.put(BODY, body.length() > Config.MAX_STORAGE_MESSAGE_CHARS ? body.substring(0,Config.MAX_STORAGE_MESSAGE_CHARS) : body);
|
||||||
values.put(TIME_SENT, timeSent);
|
values.put(TIME_SENT, timeSent);
|
||||||
values.put(ENCRYPTION, encryption);
|
values.put(ENCRYPTION, encryption);
|
||||||
values.put(STATUS, status);
|
values.put(STATUS, status);
|
||||||
|
|
Loading…
Reference in a new issue