diff options
Diffstat (limited to 'src/main/java/eu/siacs/conversations/persistance/FileBackend.java')
-rw-r--r-- | src/main/java/eu/siacs/conversations/persistance/FileBackend.java | 5 |
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java index 6e118ec2..21ba4509 100644 --- a/src/main/java/eu/siacs/conversations/persistance/FileBackend.java +++ b/src/main/java/eu/siacs/conversations/persistance/FileBackend.java @@ -114,7 +114,7 @@ public class FileBackend { } } - public static long getFileSize(Context context, Uri uri) { + private static long getFileSize(Context context, Uri uri) { Cursor cursor = context.getContentResolver().query(uri, null, null, null, null); if (cursor != null && cursor.moveToFirst()) { return cursor.getLong(cursor.getColumnIndex(OpenableColumns.SIZE)); @@ -124,6 +124,9 @@ public class FileBackend { } public static boolean allFilesUnderSize(Context context, List<Uri> uris, long max) { + if (max <= 0) { + return true; //exception to be compatible with HTTP Upload < v0.2 + } for(Uri uri : uris) { if (FileBackend.getFileSize(context, uri) > max) { return false; |