From a61b2df11932c4447f6b2bd42afaaea5dfdde366 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 15 Jun 2023 15:48:48 +1000 Subject: [PATCH] fix: conversation unread not doing a check for standard ID prefix --- .../org/thoughtcrime/securesms/util/SharedConfigUtils.kt | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/util/SharedConfigUtils.kt b/app/src/main/java/org/thoughtcrime/securesms/util/SharedConfigUtils.kt index d6b3bd3ed8..b15d82a33e 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/util/SharedConfigUtils.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/util/SharedConfigUtils.kt @@ -3,11 +3,14 @@ package org.thoughtcrime.securesms.util import network.loki.messenger.libsession_util.ConversationVolatileConfig import org.session.libsession.messaging.MessagingModuleConfiguration import org.session.libsession.utilities.GroupUtil +import org.session.libsignal.utilities.IdPrefix import org.thoughtcrime.securesms.database.model.ThreadRecord fun ConversationVolatileConfig.getConversationUnread(thread: ThreadRecord): Boolean { val recipient = thread.recipient - if (recipient.isContactRecipient && recipient.isOpenGroupInboxRecipient) { + if (recipient.isContactRecipient + && recipient.isOpenGroupInboxRecipient + && recipient.address.serialize().startsWith(IdPrefix.STANDARD.value)) { return getOneToOne(recipient.address.serialize())?.unread == true } else if (recipient.isClosedGroupRecipient) { return getLegacyClosedGroup(GroupUtil.doubleDecodeGroupId(recipient.address.toGroupString()))?.unread == true