Donate to e Foundation | Murena handsets with /e/OS | Own a part of Murena! Learn more

Commit 5dac7404 authored by Moez Bhatti's avatar Moez Bhatti
Browse files

Fix MMS appearing to have sent but not going through

Closes #1528
parent 4794167b
Loading
Loading
Loading
Loading
+5 −1
Original line number Diff line number Diff line
@@ -50,6 +50,7 @@ import com.moez.QKSMS.receiver.SendSmsReceiver
import com.moez.QKSMS.receiver.SmsDeliveredReceiver
import com.moez.QKSMS.receiver.SmsSentReceiver
import com.moez.QKSMS.util.ImageUtils
import com.moez.QKSMS.util.PhoneNumberUtils
import com.moez.QKSMS.util.Preferences
import com.moez.QKSMS.util.tryOrNull
import io.realm.Case
@@ -70,6 +71,7 @@ class MessageRepositoryImpl @Inject constructor(
    private val context: Context,
    private val imageRepository: ImageRepository,
    private val messageIds: KeyManager,
    private val phoneNumberUtils: PhoneNumberUtils,
    private val prefs: Preferences,
    private val syncRepository: SyncRepository
) : MessageRepository {
@@ -337,7 +339,9 @@ class MessageRepositoryImpl @Inject constructor(
                    .map { attachment -> attachment.vCard.toByteArray() }
                    .map { vCard -> MMSPart("contact", ContentType.TEXT_VCARD, vCard) }

            Transaction(context).sendNewMessage(subId, threadId, addresses, parts, null, null)
            val transaction = Transaction(context)
            val recipients = addresses.map(phoneNumberUtils::normalizeNumber)
            transaction.sendNewMessage(subId, threadId, recipients, parts, null, null)
        }
    }