Only get collapsed timer state when necessary.

This commit is contained in:
Michelle Tang
2026-03-26 10:50:26 -04:00
committed by Alex Hart
parent f04a0533cb
commit 2ad14800d1
2 changed files with 2 additions and 2 deletions

View File

@@ -310,7 +310,7 @@ public class ConversationMessage {
long collapsedExpirationInMs = 0;
if (CollapsedState.isHead(messageRecord.getCollapsedState())) {
collapsedSize = SignalDatabase.messages().getCollapsedCount(messageRecord.getId());
if (CollapsibleEvents.getCollapsibleType(messageRecord.getType(), messageRecord.getMessageExtras()) == CollapsibleEvents.CollapsibleType.DISAPPEARING_TIMER) {
if (CollapsibleEvents.getCollapsibleType(messageRecord.getType(), messageRecord.getMessageExtras()) == CollapsibleEvents.CollapsibleType.DISAPPEARING_TIMER && collapsedSize > 1) {
collapsedExpirationInMs = SignalDatabase.messages().getDisappearingTimerStateForCollapsedSet(messageRecord.getId());
}
}

View File

@@ -6212,7 +6212,7 @@ open class MessageTable(context: Context?, databaseHelper: SignalDatabase) : Dat
}
/**
* Returns the number of updates that belong in a collapsed update set where [messageId] is the head (first update) in that set
* Returns the number of updates that belong in a collapsed update set where [messageId] is the head (first update) in that set.
* If an event is [PENDING_COLLAPSED], we do not want to consider it part of the count until it is seen.
*/
fun getCollapsedCount(messageId: Long): Int {