Prefer incoming address over user preference
This is what google messages does.
This commit is contained in:
parent
6842e1c5b6
commit
b85dbf3b4b
|
@ -573,7 +573,11 @@ class ThreadActivity : SimpleActivity() {
|
||||||
val userPreferredSimIdx = availableSIMs.indexOfFirstOrNull { it.subscriptionId == userPreferredSimId }
|
val userPreferredSimIdx = availableSIMs.indexOfFirstOrNull { it.subscriptionId == userPreferredSimId }
|
||||||
|
|
||||||
val lastMessage = messages.lastOrNull()
|
val lastMessage = messages.lastOrNull()
|
||||||
val senderPreferredSimIdx = availableSIMs.indexOfFirstOrNull { it.subscriptionId == lastMessage?.subscriptionId }
|
val senderPreferredSimIdx = if (lastMessage?.isReceivedMessage() == true) {
|
||||||
|
availableSIMs.indexOfFirstOrNull { it.subscriptionId == lastMessage.subscriptionId }
|
||||||
|
} else {
|
||||||
|
null
|
||||||
|
}
|
||||||
|
|
||||||
val defaultSmsSubscriptionId = SmsManager.getDefaultSmsSubscriptionId()
|
val defaultSmsSubscriptionId = SmsManager.getDefaultSmsSubscriptionId()
|
||||||
val systemPreferredSimIdx = if (defaultSmsSubscriptionId >= 0) {
|
val systemPreferredSimIdx = if (defaultSmsSubscriptionId >= 0) {
|
||||||
|
@ -583,7 +587,7 @@ class ThreadActivity : SimpleActivity() {
|
||||||
null
|
null
|
||||||
}
|
}
|
||||||
|
|
||||||
return userPreferredSimIdx ?: senderPreferredSimIdx ?: systemPreferredSimIdx ?: 0
|
return senderPreferredSimIdx ?: userPreferredSimIdx ?: systemPreferredSimIdx ?: 0
|
||||||
}
|
}
|
||||||
|
|
||||||
private fun blockNumber() {
|
private fun blockNumber() {
|
||||||
|
|
Loading…
Reference in New Issue