From 1cc8cc9148f1605193fb85b7f15c1613a67162f7 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Thu, 27 Apr 2023 14:48:54 +1000 Subject: [PATCH] fix: another contact recipient config library call removed for non-standard IDs --- .../org/thoughtcrime/securesms/database/Storage.kt | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt index da97d82970..1f0673bac6 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -133,7 +133,9 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co } override fun threadDeleted(address: Address, threadId: Long) { + if (SessionId(address.serialize()).prefix != IdPrefix.STANDARD) return Log.d("Loki-DBG", "deleting thread for $address\nExecution context:\n${Thread.currentThread().stackTrace.joinToString("\n")}") + val volatile = configFactory.convoVolatile ?: return if (address.isGroup) { val groups = configFactory.userGroups ?: return @@ -228,7 +230,13 @@ open class Storage(context: Context, helper: SQLCipherOpenHelper, private val co } ?: return } // otherwise recipient is one to one - recipient.isContactRecipient -> config.getOrConstructOneToOne(recipient.address.serialize()) + recipient.isContactRecipient -> { + // don't process non-standard session IDs though + val sessionId = SessionId(recipient.address.serialize()) + if (sessionId.prefix != IdPrefix.STANDARD) return + + config.getOrConstructOneToOne(recipient.address.serialize()) + } else -> throw NullPointerException("Weren't expecting to have a convo with address ${recipient.address.serialize()}") } convo.lastRead = lastSeenTime