From 577e86e31fa82fcc2862616468656400446aecd4 Mon Sep 17 00:00:00 2001 From: Andrew Date: Tue, 23 Apr 2024 13:03:11 +0930 Subject: [PATCH] Correctly don't start disappear timer on group timer updates --- .../securesms/notifications/MarkReadReceiver.kt | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/notifications/MarkReadReceiver.kt b/app/src/main/java/org/thoughtcrime/securesms/notifications/MarkReadReceiver.kt index 9f83726f46..59681c1f8a 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/notifications/MarkReadReceiver.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/notifications/MarkReadReceiver.kt @@ -61,11 +61,15 @@ class MarkReadReceiver : BroadcastReceiver() { val mmsSmsDatabase = DatabaseComponent.get(context).mmsSmsDatabase() + val threadDb = DatabaseComponent.get(context).threadDatabase() + // start disappear after read messages except TimerUpdates in groups. markedReadMessages .filter { it.expiryType == ExpiryType.AFTER_READ } .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()) } hashToDisappearAfterReadMessage(context, markedReadMessages)?.let {