mirror of
https://github.com/SimpleMobileTools/Simple-SMS-Messenger.git
synced 2025-02-01 01:46:46 +01:00
Use vertical bar '|' as the address separator
Sometimes, an address might contain a space character and that conflicts when space is also used as address separator
This commit is contained in:
parent
95c02be871
commit
d595ac8135
@ -26,6 +26,7 @@ import android.text.TextUtils
|
||||
import androidx.core.app.NotificationCompat
|
||||
import androidx.core.app.RemoteInput
|
||||
import com.klinker.android.send_message.Settings
|
||||
import com.klinker.android.send_message.Transaction
|
||||
import com.simplemobiletools.commons.extensions.*
|
||||
import com.simplemobiletools.commons.helpers.*
|
||||
import com.simplemobiletools.commons.models.PhoneNumber
|
||||
@ -104,7 +105,7 @@ fun Context.getMessages(threadId: Long, getImageResolutions: Boolean, dateFrom:
|
||||
val thread = cursor.getLongValue(Sms.THREAD_ID)
|
||||
val subscriptionId = cursor.getIntValue(Sms.SUBSCRIPTION_ID)
|
||||
val status = cursor.getIntValue(Sms.STATUS)
|
||||
val participants = senderNumber.split(" ").map { number ->
|
||||
val participants = senderNumber.split(Transaction.ADDRESS_SEPARATOR).map { number ->
|
||||
val phoneNumber = PhoneNumber(number, 0, "", number)
|
||||
val participantPhoto = getNameAndPhotoFromPhoneNumber(number)
|
||||
SimpleContact(0, 0, participantPhoto.name, photoUri, arrayListOf(phoneNumber), ArrayList(), ArrayList())
|
||||
@ -813,7 +814,12 @@ fun Context.showMessageNotification(address: String, body: String, threadId: Lon
|
||||
notificationManager.notify(threadId.hashCode(), builder.build())
|
||||
}
|
||||
|
||||
private fun Context.getMessagesStyle(notificationManager: NotificationManager, threadId: Long, sender: String, body: String): NotificationCompat.MessagingStyle {
|
||||
private fun Context.getMessagesStyle(
|
||||
notificationManager: NotificationManager,
|
||||
threadId: Long,
|
||||
sender: String,
|
||||
body: String
|
||||
): NotificationCompat.MessagingStyle {
|
||||
val oldMessages = getOldMessages(notificationManager, threadId)
|
||||
val messages = NotificationCompat.MessagingStyle(getString(R.string.me))
|
||||
oldMessages.forEach {
|
||||
|
Loading…
x
Reference in New Issue
Block a user