From 3642aaa511dfb827b256ee7f8c17c5fd266488c7 Mon Sep 17 00:00:00 2001 From: 0x330a <92654767+0x330a@users.noreply.github.com> Date: Wed, 8 Mar 2023 10:22:08 +1100 Subject: [PATCH] chore: extra missed existing group --- .../java/org/thoughtcrime/securesms/database/Storage.kt | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) 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 7a13fe8d28..79e8f06f41 100644 --- a/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt +++ b/app/src/main/java/org/thoughtcrime/securesms/database/Storage.kt @@ -410,10 +410,13 @@ class Storage(context: Context, helper: SQLCipherOpenHelper, private val configF for (group in lgc) { if (group !is GroupInfo.LegacyGroupInfo) continue val existingGroup = existingClosedGroups.firstOrNull { GroupUtil.doubleDecodeGroupId(it.encodedId) == group.sessionId } + val existingThread = existingGroup?.let { getThreadId(existingGroup.encodedId) } if (existingGroup != null) { Log.d("Loki-DBG", "Existing closed group, don't add") - if (group.hidden) { - threadDb.setThreadArchived(existingGroup.) + if (group.hidden && existingThread != null) { + threadDb.setThreadArchived(existingThread) + } else if (existingThread == null) { + Log.w("Loki-DBG", "Existing group had no thread to hide") } } else { val members = group.members.keys.map { Address.fromSerialized(it) }