mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-06-05 21:49:22 +02:00
handle sending group SMS
- in Context.getMessages, split the sender number by spaces " " to get each contact. - apply update in the android-smsmms lib - do not pass threadId in Transaction.sendNewMessage
This commit is contained in:
@@ -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()
|
||||
|
@@ -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(" ").filter { it.areDigitsOnly() }.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)
|
||||
}
|
||||
|
||||
|
@@ -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)
|
||||
}
|
||||
|
@@ -30,7 +30,7 @@ class HeadlessSmsSendService : Service() {
|
||||
transaction.setExplicitBroadcastForSentSms(smsSentIntent)
|
||||
transaction.setExplicitBroadcastForDeliveredSms(deliveredIntent)
|
||||
|
||||
transaction.sendNewMessage(message, getThreadId(number))
|
||||
transaction.sendNewMessage(message)
|
||||
} catch (ignored: Exception) {
|
||||
}
|
||||
|
||||
|
Reference in New Issue
Block a user