improve the way subsequent message SIM IDs are marked

This commit is contained in:
tibbi 2022-05-31 16:50:16 +02:00
parent 21dd529846
commit 06bc45514b
1 changed files with 2 additions and 1 deletions

View File

@ -638,7 +638,8 @@ class ThreadActivity : SimpleActivity() {
val message = messages.getOrNull(i) ?: continue
// do not show the date/time above every message, only if the difference between the 2 messages is at least MIN_DATE_TIME_DIFF_SECS,
// or if the message is sent from a different SIM
if (message.date - prevDateTime > MIN_DATE_TIME_DIFF_SECS || prevSIMId != message.subscriptionId) {
val isSentFromDifferentKnownSIM = prevSIMId != -1 && message.subscriptionId != -1 && prevSIMId != message.subscriptionId
if (message.date - prevDateTime > MIN_DATE_TIME_DIFF_SECS || isSentFromDifferentKnownSIM) {
val simCardID = subscriptionIdToSimId[message.subscriptionId] ?: "?"
items.add(ThreadDateTime(message.date, simCardID))
prevDateTime = message.date