feat: add settings option to customise the MMS file size limit

This commit is contained in:
Paul Akhamiogu 2021-09-06 22:25:38 +01:00
parent b317507370
commit c3c2ce4ee3
27 changed files with 246 additions and 8 deletions

View file

@ -602,12 +602,12 @@ class ThreadActivity : SimpleActivity() {
val attachmentView = addAttachmentView(originalUriString, uri)
val mimeType = contentResolver.getType(uri) ?: return
if (mimeType.isImageMimeType()) {
if (mimeType.isImageMimeType() && config.mmsFileSizeLimit != FILE_SIZE_NONE) {
val selection = attachmentSelections[originalUriString]
attachmentSelections[originalUriString] = selection!!.copy(isPending = true)
checkSendMessageAvailability()
attachmentView.thread_attachment_progress.beVisible()
imageCompressor.compressImage(uri, IMAGE_COMPRESS_SIZE) { compressedUri ->
imageCompressor.compressImage(uri, config.mmsFileSizeLimit) { compressedUri ->
runOnUiThread {
if (compressedUri != null) {
attachmentSelections[originalUriString] = AttachmentSelection(compressedUri, false)