mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-27 12:05:22 +00:00
Implement file size limit
This commit is contained in:
parent
98d4ee1724
commit
cb1553631e
@ -3,13 +3,12 @@ package org.thoughtcrime.securesms.mms;
|
|||||||
import android.content.Context;
|
import android.content.Context;
|
||||||
|
|
||||||
import org.thoughtcrime.securesms.util.Util;
|
import org.thoughtcrime.securesms.util.Util;
|
||||||
|
import org.whispersystems.signalservice.loki.api.LokiFileServerAPI;
|
||||||
|
|
||||||
public class PushMediaConstraints extends MediaConstraints {
|
public class PushMediaConstraints extends MediaConstraints {
|
||||||
|
|
||||||
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
|
private static final int MAX_IMAGE_DIMEN_LOWMEM = 768;
|
||||||
private static final int MAX_IMAGE_DIMEN = 4096;
|
private static final int MAX_IMAGE_DIMEN = 4096;
|
||||||
private static final int KB = 1024;
|
|
||||||
private static final int MB = 1024 * KB;
|
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getImageMaxWidth(Context context) {
|
public int getImageMaxWidth(Context context) {
|
||||||
@ -23,26 +22,26 @@ public class PushMediaConstraints extends MediaConstraints {
|
|||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getImageMaxSize(Context context) {
|
public int getImageMaxSize(Context context) {
|
||||||
return 6 * MB;
|
return LokiFileServerAPI.Companion.getMaxFileSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getGifMaxSize(Context context) {
|
public int getGifMaxSize(Context context) {
|
||||||
return 25 * MB;
|
return LokiFileServerAPI.Companion.getMaxFileSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getVideoMaxSize(Context context) {
|
public int getVideoMaxSize(Context context) {
|
||||||
return 100 * MB;
|
return LokiFileServerAPI.Companion.getMaxFileSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getAudioMaxSize(Context context) {
|
public int getAudioMaxSize(Context context) {
|
||||||
return 100 * MB;
|
return LokiFileServerAPI.Companion.getMaxFileSize();
|
||||||
}
|
}
|
||||||
|
|
||||||
@Override
|
@Override
|
||||||
public int getDocumentMaxSize(Context context) {
|
public int getDocumentMaxSize(Context context) {
|
||||||
return 100 * MB;
|
return LokiFileServerAPI.Companion.getMaxFileSize();
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user