Correctly don't start disappear timer on group timer updates

This commit is contained in:
Andrew 2024-04-23 13:03:11 +09:30
parent dbe3834dc1
commit 577e86e31f

View File

@ -61,11 +61,15 @@ class MarkReadReceiver : BroadcastReceiver() {
val mmsSmsDatabase = DatabaseComponent.get(context).mmsSmsDatabase() val mmsSmsDatabase = DatabaseComponent.get(context).mmsSmsDatabase()
val threadDb = DatabaseComponent.get(context).threadDatabase()
// start disappear after read messages except TimerUpdates in groups. // start disappear after read messages except TimerUpdates in groups.
markedReadMessages markedReadMessages
.filter { it.expiryType == ExpiryType.AFTER_READ } .filter { it.expiryType == ExpiryType.AFTER_READ }
.map { it.syncMessageId } .map { it.syncMessageId }
.filter { mmsSmsDatabase.getMessageForTimestamp(it.timetamp)?.run { isExpirationTimerUpdate && recipient.isClosedGroupRecipient } == false } .filter { mmsSmsDatabase.getMessageForTimestamp(it.timetamp)?.run {
isExpirationTimerUpdate && threadDb.getRecipientForThreadId(threadId)?.isGroupRecipient == true } == false
}
.forEach { messageExpirationManager.startDisappearAfterRead(it.timetamp, it.address.serialize()) } .forEach { messageExpirationManager.startDisappearAfterRead(it.timetamp, it.address.serialize()) }
hashToDisappearAfterReadMessage(context, markedReadMessages)?.let { hashToDisappearAfterReadMessage(context, markedReadMessages)?.let {