mirror of
https://github.com/oxen-io/session-android.git
synced 2024-11-28 20:45:17 +00:00
fix: conversation unread not doing a check for standard ID prefix
This commit is contained in:
parent
b495e59abb
commit
a61b2df119
@ -3,11 +3,14 @@ package org.thoughtcrime.securesms.util
|
|||||||
import network.loki.messenger.libsession_util.ConversationVolatileConfig
|
import network.loki.messenger.libsession_util.ConversationVolatileConfig
|
||||||
import org.session.libsession.messaging.MessagingModuleConfiguration
|
import org.session.libsession.messaging.MessagingModuleConfiguration
|
||||||
import org.session.libsession.utilities.GroupUtil
|
import org.session.libsession.utilities.GroupUtil
|
||||||
|
import org.session.libsignal.utilities.IdPrefix
|
||||||
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
import org.thoughtcrime.securesms.database.model.ThreadRecord
|
||||||
|
|
||||||
fun ConversationVolatileConfig.getConversationUnread(thread: ThreadRecord): Boolean {
|
fun ConversationVolatileConfig.getConversationUnread(thread: ThreadRecord): Boolean {
|
||||||
val recipient = thread.recipient
|
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
|
return getOneToOne(recipient.address.serialize())?.unread == true
|
||||||
} else if (recipient.isClosedGroupRecipient) {
|
} else if (recipient.isClosedGroupRecipient) {
|
||||||
return getLegacyClosedGroup(GroupUtil.doubleDecodeGroupId(recipient.address.toGroupString()))?.unread == true
|
return getLegacyClosedGroup(GroupUtil.doubleDecodeGroupId(recipient.address.toGroupString()))?.unread == true
|
||||||
|
Loading…
Reference in New Issue
Block a user