Send MMS attachments separately
If the message contains text, it is sent with the last attachment.
This commit is contained in:
parent
8158531315
commit
c931eb0171
2 changed files with 13 additions and 3 deletions
|
|
@ -40,7 +40,16 @@ fun Context.sendMessageCompat(text: String, addresses: List<String>, subId: Int?
|
|||
|
||||
val isMms = attachments.isNotEmpty() || isLongMmsMessage(text, settings) || addresses.size > 1 && settings.group
|
||||
if (isMms) {
|
||||
messagingUtils.sendMmsMessage(text, addresses, attachments, settings)
|
||||
// we send all MMS attachments separately to reduces the chances of hitting provider MMS limit.
|
||||
if (attachments.size > 1) {
|
||||
for (i in 0 until attachments.lastIndex - 1) {
|
||||
val attachment = attachments[i]
|
||||
messagingUtils.sendMmsMessage("", addresses, listOf(attachment), settings)
|
||||
}
|
||||
}
|
||||
|
||||
val lastAttachment = attachments[attachments.lastIndex]
|
||||
messagingUtils.sendMmsMessage(text, addresses, listOf(lastAttachment), settings)
|
||||
} else {
|
||||
try {
|
||||
messagingUtils.sendSmsMessage(text, addresses.toSet(), settings.subscriptionId, settings.deliveryReports)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue