diff options
author | Christian S <christian@pix-art.de> | 2016-03-05 19:35:12 +0100 |
---|---|---|
committer | Christian S <christian@pix-art.de> | 2016-03-05 19:35:12 +0100 |
commit | 9fb696945b9d4ba511498562db6393886dd52efd (patch) | |
tree | 6cc2c4090f76f67d861545b6ddc3de3e420a9aeb /src | |
parent | 23923b5c82bc07fd1df09b9e6b911531e80ff48b (diff) |
only resend files smaller than 1 MiB automatically
Diffstat (limited to 'src')
-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); |