diff options
Diffstat (limited to 'src/main/java/eu')
-rw-r--r-- | src/main/java/eu/siacs/conversations/Config.java | 4 | ||||
-rw-r--r-- | src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java | 2 |
2 files changed, 4 insertions, 2 deletions
diff --git a/src/main/java/eu/siacs/conversations/Config.java b/src/main/java/eu/siacs/conversations/Config.java index 947708279..179ab6a88 100644 --- a/src/main/java/eu/siacs/conversations/Config.java +++ b/src/main/java/eu/siacs/conversations/Config.java @@ -73,7 +73,9 @@ public final class Config { public static final int IMAGE_SIZE = 1920; public static final Bitmap.CompressFormat IMAGE_FORMAT = Bitmap.CompressFormat.JPEG; public static final int IMAGE_QUALITY = 75; - public static final int IMAGE_MAX_SIZE = 524288; //512KiB + public static final int IMAGE_MAX_SIZE = 524288; //512 KiB + + public static final int FILE_MAX_SIZE = 1048576; //1 MiB public static final int MESSAGE_MERGE_WINDOW = 20; diff --git a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java index e7cc3aa60..c1bc897d7 100644 --- a/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java +++ b/src/main/java/eu/siacs/conversations/http/HttpUploadConnection.java @@ -94,7 +94,7 @@ public class HttpUploadConnection implements Transferable { private void fail() { mHttpConnectionManager.finishUploadConnection(this); message.setTransferable(null); - if (!canceled){ + if (!canceled && file.getExpectedSize()<=Config.FILE_MAX_SIZE){ mXmppConnectionService.resendMessage(message, delayed); } else { mXmppConnectionService.markMessage(message, Message.STATUS_SEND_FAILED); |