mirror of
https://github.com/quik-sms/quik.git
synced 2026-11-15 10:38:53 +01:00
Merge pull request #254 from gavine99/mms-attachment-share-242
fixes for mms attachment view/share is suboptimal (#242) and other small fixups
This commit is contained in:
@@ -21,14 +21,14 @@ package dev.octoshrimpy.quik.extensions
|
||||
import com.google.android.mms.ContentType
|
||||
import dev.octoshrimpy.quik.model.MmsPart
|
||||
|
||||
fun MmsPart.isSmil() = ContentType.APP_SMIL == type
|
||||
fun MmsPart.isSmil() = ContentType.APP_SMIL.lowercase() == type.lowercase()
|
||||
|
||||
fun MmsPart.isImage() = ContentType.isImageType(type)
|
||||
fun MmsPart.isImage() = ContentType.isImageType(type.lowercase())
|
||||
|
||||
fun MmsPart.isVideo() = ContentType.isVideoType(type)
|
||||
fun MmsPart.isVideo() = ContentType.isVideoType(type.lowercase())
|
||||
|
||||
fun MmsPart.isAudio() = ContentType.isAudioType(type)
|
||||
fun MmsPart.isAudio() = ContentType.isAudioType(type.lowercase())
|
||||
|
||||
fun MmsPart.isText() = ContentType.TEXT_PLAIN == type
|
||||
fun MmsPart.isText() = ContentType.TEXT_PLAIN.lowercase() == type.lowercase()
|
||||
|
||||
fun MmsPart.isVCard() = ContentType.TEXT_VCARD == type
|
||||
fun MmsPart.isVCard() = ContentType.TEXT_VCARD.lowercase() == type.lowercase()
|
||||
|
||||
@@ -443,8 +443,8 @@ class MessageRepositoryImpl @Inject constructor(
|
||||
|
||||
imageBytesByAttachment.forEach { (attachment, bytes) ->
|
||||
parts += when (attachment.getType(context) == "image/gif") {
|
||||
true -> MMSPart("image", ContentType.IMAGE_GIF, bytes)
|
||||
false -> MMSPart("image", ContentType.IMAGE_JPEG, bytes)
|
||||
true -> MMSPart(attachment.getName(context), ContentType.IMAGE_GIF, bytes)
|
||||
false -> MMSPart(attachment.getName(context), ContentType.IMAGE_JPEG, bytes)
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user