Merge pull request #334 from KryptKode/feat/group-sms

handle sending group SMS
This commit is contained in:
Tibor Kaputa 2022-05-01 22:48:58 +02:00 committed by GitHub
commit a94be22ad0
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 9 additions and 6 deletions

View File

@ -829,7 +829,7 @@ class ThreadActivity : SimpleActivity() {
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
refreshedSinceSent = false
transaction.sendNewMessage(message, threadId)
transaction.sendNewMessage(message)
thread_type_message.setText("")
attachmentSelections.clear()
thread_attachments_holder.beGone()

View File

@ -103,10 +103,13 @@ fun Context.getMessages(threadId: Long, getImageResolutions: Boolean): ArrayList
val thread = cursor.getLongValue(Sms.THREAD_ID)
val subscriptionId = cursor.getIntValue(Sms.SUBSCRIPTION_ID)
val status = cursor.getIntValue(Sms.STATUS)
val phoneNumber = PhoneNumber(senderNumber, 0, "", senderNumber)
val participant = SimpleContact(0, 0, senderName, photoUri, arrayListOf(phoneNumber), ArrayList(), ArrayList())
val participants = senderNumber.split(" ").map { number ->
val phoneNumber = PhoneNumber(number, 0, "", number)
val participantPhoto = getNameAndPhotoFromPhoneNumber(number)
SimpleContact(0, 0, participantPhoto.name, photoUri, arrayListOf(phoneNumber), ArrayList(), ArrayList())
}
val isMMS = false
val message = Message(id, body, type, status, arrayListOf(participant), date, read, thread, isMMS, null, senderName, photoUri, subscriptionId)
val message = Message(id, body, type, status, ArrayList(participants), date, read, thread, isMMS, null, senderName, photoUri, subscriptionId)
messages.add(message)
}

View File

@ -35,7 +35,7 @@ class DirectReplyReceiver : BroadcastReceiver() {
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
transaction.sendNewMessage(message, threadId)
transaction.sendNewMessage(message)
} catch (e: Exception) {
context.showErrorToast(e)
}

View File

@ -30,7 +30,7 @@ class HeadlessSmsSendService : Service() {
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
transaction.sendNewMessage(message, getThreadId(number))
transaction.sendNewMessage(message)
} catch (ignored: Exception) {
}