aboutsummaryrefslogtreecommitdiffstats
path: root/src/main
diff options
context:
space:
mode:
Diffstat (limited to 'src/main')
-rw-r--r--src/main/java/de/pixart/messenger/Config.java1
-rw-r--r--src/main/java/de/pixart/messenger/entities/Message.java2
2 files changed, 2 insertions, 1 deletions
diff --git a/src/main/java/de/pixart/messenger/Config.java b/src/main/java/de/pixart/messenger/Config.java
index eef639e40..8b095a149 100644
--- a/src/main/java/de/pixart/messenger/Config.java
+++ b/src/main/java/de/pixart/messenger/Config.java
@@ -94,6 +94,7 @@ public final class Config {
public static boolean PUT_AUTH_TAG_INTO_KEY = false;
public static final int MAX_DISPLAY_MESSAGE_CHARS = 4096;
+ public static final int MAX_STORAGE_MESSAGE_CHARS = 1024 * 1024 * 1024;
public static final boolean ExportLogs = true; // automatically export logs
public static final int ExportLogs_Hour = 4; //valid values from 0 to 23
diff --git a/src/main/java/de/pixart/messenger/entities/Message.java b/src/main/java/de/pixart/messenger/entities/Message.java
index 5a3549a95..bf53b3cd7 100644
--- a/src/main/java/de/pixart/messenger/entities/Message.java
+++ b/src/main/java/de/pixart/messenger/entities/Message.java
@@ -219,7 +219,7 @@ public class Message extends AbstractEntity {
} else {
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(ENCRYPTION, encryption);
values.put(STATUS, status);