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 {